[R] Mathematical annotation axis in lattice

Coster, Albart Albart.Coster at wur.nl
Tue Jul 7 13:35:08 CEST 2009


Dear list,

making mathematical expressions in plots is not difficult: expression(phi[1]) for example. At this moment I am stuck in creating a vector of expressions:

pos <- 1:10
lab <- letters[pos]

Now, I would like to create a vector of expressions which I could use for labeling the x-axis of a lattice plot. 

ll <- as.expression(paste(pos," phi[",lab,"]",sep = "")

xyplot(1:10~11:10,scales = list(x = list(labels = ll,at = 1:10)))

does not work. I read about the function substitute, but that did not solve it.

Could you recommend me how I should do this? 

Thanks in advance,

Albart Coster

Wageningen Universiteit
Netherlands




More information about the R-help mailing list