Trying to make a strip in lattice xyplots to display shingle intervals
with a sensible number of digits:


First I make a 2x2 matrix with rounded values of the shingle itnervals:

lec <- round(matrix(unlist(levels(equal.count(sd$Frother))), ncol = 2,
byrow = TRUE), 3)

Next I make a custom strip function to handle the difference between a
factor proper and a shingle:

my.strip <- function(which.given, which.panel, ..., shingle.intervals) {
                if (which.given == 1) {
                        strip.default(which.given, which.panel, ...,strip.name 
= FALSE,
strip.levels = TRUE, shingle.intervals = lec)
                } else {
                        strip.default(which.given, which.panel, ..., strip.name 
= FALSE,
strip.levels = TRUE)
                }
}

Then the call to xyplot.

xyplot(Grade ~ Recovery| equal.count(Frother) + Row,
       groups = interaction(Row1.Mode, Row3.Mode, drop = TRUE),
       data = sd, pch = 1, layout = c(6,2),
       main = 'By Row and Frother dosing',
         strip = my.strip,
       sub = 'Colour indicates control mode',
         auto.key = list(columns = 5))


This however still gives full precision levels.

Any help much appreciated.

Alex van der Spek

______________________________________________
R-help@r-project.org 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.

Reply via email to