[R] Direction of panel plots in trellis graphics

Richard M. Heiberger rmh at temple.edu
Fri Jul 13 15:26:22 CEST 2007


You can control the panel sequence with subscripting and transpose.
Here are several examples.  I think tmp.tr3 is the one you asked for.

library(lattice)

tmp <- data.frame(x=rnorm(24), y=rnorm(24), a=rep(letters[1:6],4), b=rep(LETTERS[1:4],each=6))
tmp.tr <- xyplot(y ~ x | a*b, data=tmp)
tmp.tr
t(tmp.tr)

tmp.tr2 <- xyplot(y ~ x | a, data=tmp)
tmp.tr2
tmp.tr2[c(1,3,5,2,4,6)]

tmp.tr3 <- xyplot(y ~ x | a, data=tmp, as.table=TRUE)
tmp.tr3
tmp.tr3[c(1,3,5,2,4,6)]
 
Rich



More information about the R-help mailing list