I'm trying to create a 5-panel xyplot with each strip labelled by treatment. The code is as follows: xyplot(log(pfuml)~Transfer|Treat,groups=Pop,ylab="Log10 Pfu/ml",as.table=T, type="a", auto.key list(space="right",points=F,lines=T)) I've tried: strip=strip.custom(factor.levels=c("0","2","4","8","16") But it's not working, I still only get "Treat" printed on each strip. Any ideas? Thank you, Julie [[alternative HTML version deleted]]
On 2012-06-18 10:02, Julie Truman wrote:> I'm trying to create a 5-panel xyplot with each strip labelled by treatment. The code is as follows: > > xyplot(log(pfuml)~Transfer|Treat,groups=Pop,ylab="Log10 Pfu/ml",as.table=T, > type="a", > auto.key> list(space="right",points=F,lines=T)) > > > > I've tried: > > strip=strip.custom(factor.levels=c("0","2","4","8","16") > > But it's not working, I still only get "Treat" printed on each strip. Any ideas?Convert your Treat variable to a factor with appropriate levels before plotting or (less desirable) use as.factor(Treat) in place of Treat. A couple of bits of advice for future posts: 1. We don't have your data, so either provide relevant information about it ( str() is useful) or, if possible, illustrate your problem with a built-in dataset. Or make up some data to illustrate the problem. 2. Excise extraneous information from your code; here we don't need your ylab, as.table, groups, type, auto.key. Peter Ehlers> > Thank you, > > Julie > > > > > > [[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.
Hi Julie Try strip.custom(factor.levels = paste("Treat", c("0","2","4","8","16"), sep = " ") i.e xyplot(log(pfuml)~Transfer|Treat,groups=Pop,ylab="Log10 Pfu/ml",as.table=T, type="a", auto.key=list(space="right",points=F,lines=T) ), strip=strip.custom(factor.levels = paste("Treat", c("0","2","4","8","16"), sep = " "),par.strip.text = list(cex = 0.85) ) ) Should work but without an example ... I have added par.strip.text in case the size is not right for you as an example for future use Regards Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England Armidale NSW 2351 Email: home: mackay at northnet.com.au At 03:02 19/06/2012, you wrote:>I'm trying to create a 5-panel xyplot with each strip labelled by >treatment. The code is as follows: > >xyplot(log(pfuml)~Transfer|Treat,groups=Pop,ylab="Log10 Pfu/ml",as.table=T, > type="a", > auto.key> list(space="right",points=F,lines=T)) > > > >I've tried: > >strip=strip.custom(factor.levels=c("0","2","4","8","16") > >But it's not working, I still only get "Treat" printed on each >strip. Any ideas? > >Thank you, > >Julie > > > > > > [[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.