rlatticenlmetrellis

Make panels fill screen in lattice?


I am plotting out some grouped data from nlme and I have 120 panels. The default plotting plot(dataG) puts them in 2 rows, 60 columns, which fills up the screen, but is too difficult to read. When I specify the layout plot(dataG), layout= c(12,10)), I get the right number of rows and columns, but the columns are all smooshed together.

I'm not sure if the problem is because everything is happening inside nlme, but I haven't found a solution in my nlme book.

You can find the data here

https://www.dropbox.com/s/79tssi252ai0ez8/COBS%20Roots%202008-2013noCNfake08.txt .

And the code to define the grouping:

roots<-read.table("COBS Roots 2008-2013noCNfake08.txt", header = TRUE)
library(nlme)
roots$EU<- with(roots, factor(plot):factor(depth))
rootsG<-groupedData(mass ~ year | EU, data=roots)

plot(rootsG, layout = c(12, 10))

Solution

  • I was able to produce a 12 by 10 panel graph using the lattice package. Hopefully it can get you headed in the right direction.

    > roots <-read.table("COBS Roots 2008-2013noCNfake08.txt", header = TRUE)
    > roots$EU <- with(roots, factor(plot):factor(depth))
    > library(lattice)
    > xyplot(mass ~ year | EU, data = roots, layout = c(12,10))
    

    enter image description here