Skip to content
Prev 22824 / 398502 Next

More help with Lattice

--- Jean-Pierre Gattuso <gattuso at obs-vlfr.fr> wrote:
This one's easy. For example, 

x <- rnorm(100)
y <- equal.count(rnorm(100))
z <- equal.count(rnorm(100))

ylabels <- substring(as.character(levels(y)), 2)
## or,  if these are too long
## ylabels <- substring(as.character(lapply(levels(y), round, 3)), 2)

bwplot(y ~ x | z, scales = list(y = list(labels = ylabels)))
This might be a problem if you don't want to use the strip function, since a
panel function is usually not sent any information about which levels of the
conditioning variable it corresponds to. With strip, it should be easy:

zlabels <- substring(as.character(levels(z)), 2)
bwplot(y ~ x | z, strip = function(which.given, ...)    
       grid.text(zlabels[which.given]))
## assuming that you have only one conditioning variable
Currently, there's not much else. (Incidentally, everything I used is
documented in the help pages, although they might be a bit difficult to find.)
A web page is in the making (at packages.r-project.org/lattice), but I haven't
gotten around to really starting it up yet.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


__________________________________________________



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._