[R] Variable names in lattice XY-plot

ukoenig at med.uni-marburg.de ukoenig at med.uni-marburg.de
Fri Jul 3 21:12:56 CEST 2009


Hi,
how can I get a more descriptive text
instead of the variable names in my XY-lattice plot,
according to the table below?

Variable    text
acet     = "Acetylaspartate Thalamus"
chol     = "Choline Thalamus"
acetp    = "Acetylaspartate parieoc"
ino      = "Inositole Thalamus"


I could not find a solution.
Please have a look at my syntax.
Thanks a lot,
Udo



library(lattice)

grp <-c(0,1,0,1)
zp <- c(1,1,2,2)
acet <- c(1.7,1.8,1.9,1.8)
chol <- c(0.6, 0.8,0.8, 0.7)
ino <- c(0.6, 0.3, 0.5, 0.4)
acetp <- c(1.8, 1.9, 2.0, 1.8)

data <- data.frame(cbind(grp, zp, acet, chol, ino, acetp))
data$grp <- factor(data$grp)
levels(data$grp) <- c("low","high")


xyplot(acet+chol+ino+acetp ~ zp,
        group=grp,
        data=data,
        type="l",
        scales=list(relation="free"),
        auto.key=list(title="Neurotransmitters", border=TRUE))




More information about the R-help mailing list