[R] question on using lattice panel plots

Ranjan Maitra maitra at iastate.edu
Thu Apr 16 21:43:45 CEST 2009


Hi,

I think this question is best explained using the following
self-contained toy example:




## cut code here and paste to R window

z <- cbind(rep(c("BIC", "hist"), each = 150), rep(rep(c(5, 10, 30),
each = 50),2))

z <- as.data.frame(z)

z <- cbind(z, runif(300))

names(z) <- c("Method", "sigma", "Error")

library(lattice)

bwplot(Error~Method | sigma, data = z, horiz = F, xlab = "Method",
layout = c(3,1))


## end code




Now the question:

I would like the panels to be in the order of sigma, i. e. 5, 10, 30
and not 10, 30 and 5 as is currently the case. Is this possible?

Not to seek too much indulgence, but to ask anyway, I wonder if it is
possible to have a Greek sigma = 5, a Greek sigma = 10 and a Greek
sigma = 30. (Sort of what we would get using expression(sigma == 5), 
expression(sigma == 10), expression(sigma == 10) on "base" R figures).

Please let me know if my question is not clear.

Many thanks for any suggestions and help and best wishes!
Ranjan




More information about the R-help mailing list