[R] Changing strip text

Peter Ehlers ehlers at ucalgary.ca
Tue Jun 19 00:34:25 CEST 2012


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.



More information about the R-help mailing list