r - What is the equivalent of facet_wrap in Lattice -
say have data this:
dta <- data.frame( group = rep(letters[1:8], each=1000), x = runif(8000), y=runif(8000) )
i produce lattice plot containing y ~ x each group. but, groups a-d on first row, , e-h on second row. i.e., equivalent of
qplot(x=x, y=y, data=dta) + facet_wrap(~ group, nrow=2)
but in lattice. best way this?
library(lattice) xyplot(y ~ x | group, dta, layout=c(4,2), as.table = true)
as suggested @benbarnes, as.table = true
keeps order of facets.
Comments
Post a Comment