Re: [R] Adding per-panel text to panel strips in lattice xyplot

From: Richard M. Heiberger <rmh_at_temple.edu>
Date: Fri 13 Oct 2006 - 18:23:20 GMT


Take a look at the xysplom function in package HH. You can use it as a model for what you want.

tmp <- data.frame(x=rnorm(24),
                  y=rnorm(24),
                  a=factor(rep(letters[1:2],12)),
                  b=factor(rep(LETTERS[1:3], c(8,8,8))))
xysplom(y ~ x | a*b, data=tmp, corr=TRUE, layout=c(2,3))  

The work is done with the cooperation of two functions.

xysplom.default looks for the corr argument and then creates an additional conditioning factor and gives it a constant value.

strip.xysplom sees where it is and changes the strip label as needed.

strip.xysplom uses the R-2.3.1 technology for finding where it is. Deepayan added some more functions in R-2.4.1, so that part of the code can now be somewhat simplified.

lattice in R-2.4.0 also has a new strip.left argument (see ?xyplot and serach for strip.left) that will allow you to put the additional information in an additional left strip for each panel, rather than by making changes to one of the standard top strips.

Rich



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat Oct 14 05:42:34 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 13 Oct 2006 - 20:30:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.