Henning Wildhagen
2008-Aug-04 10:24 UTC
[R] xyplot strip=function for two conditioning variables
Dear list, for a data structure like in df: set.seed(100) Treatment<-rep(c("Nitrogen","Carbon", "Sulfur"),each=9) week<-rep(c(1,5,9),3,each=3) genes<-rep(c("18s", "EF1b", "NR"),9) copies<-rnorm(27, 1000000,400000) df<-data.frame(Treatment,week,genes,copies) i wrote this code for a xyplot: library(lattice) PLOT<-xyplot(data=df, copies~week|Treatment+genes,type=c("b","g")) I would like to change PLOT in a way, that the strips for Treatment are displayed only once at the top of each of the three columns. Additionally i would like to strips for "genes" at the top of each panel. I tried to adopt some code i found in the helplist using strip=function... but i did not manage to get what i would like. Can anyone give me advice? Thanks, Henning -- [[alternative HTML version deleted]]
Gabor Grothendieck
2008-Aug-04 10:36 UTC
[R] xyplot strip=function for two conditioning variables
Checkout this one: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/82452.html On Mon, Aug 4, 2008 at 6:24 AM, Henning Wildhagen <HWildhagen at gmx.de> wrote:> Dear list, > > for a data structure like in df: > > set.seed(100) > Treatment<-rep(c("Nitrogen","Carbon", "Sulfur"),each=9) > week<-rep(c(1,5,9),3,each=3) > genes<-rep(c("18s", "EF1b", "NR"),9) > copies<-rnorm(27, 1000000,400000) > df<-data.frame(Treatment,week,genes,copies) > > i wrote this code for a xyplot: > > library(lattice) > PLOT<-xyplot(data=df, copies~week|Treatment+genes,type=c("b","g")) > > I would like to change PLOT in a way, that the strips for Treatment are > displayed only once at the top of each of the three columns. Additionally i > would like to strips for "genes" at the top of each panel. > > I tried to adopt some code i found in the helplist using strip=function... > but i did not manage to get what i would like. > > Can anyone give me advice? > > Thanks, > > Henning > > > -- > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >