[R] Variable names in lattice XY-plot

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri Jul 3 22:45:57 CEST 2009


On Fri, Jul 3, 2009 at 1:02 PM, baptiste
auguie<baptiste.auguie at googlemail.com> wrote:
> ?strip.custom
>
>
> p <-
> xyplot(acet+chol+ino+acetp ~ zp,
>      group=grp,
>      data=data,
>      type="l",
>      scales=list(relation="free"),
>      auto.key=list(title="
>>
>> Neurotransmitters", border=TRUE))
>
>
>
> update(p, strip=strip.custom(factor.levels=letters[1:4]))

Or,

> dimnames(p)
[[1]]
[1] "acet"  "chol"  "ino"   "acetp"
> dimnames(p)[[1]]
[1] "acet"  "chol"  "ino"   "acetp"
> dimnames(p)[[1]] <- c("Acetylaspartate Thalamus", "Choline Thalamus", "Acetylaspartate parieoc", "Inositole Thalamus")
> p

which is more easily generalizable when more than one conditioning
variable is involved.

-Deepayan




More information about the R-help mailing list