David Parkhurst wrote:
I have a data frame with five columns, x, y, A, B, and C. x and y are
continuous numeric variables, and the others are factors.
A has 5 levels, B has 2, and C has 6. I'd like to produce a 5X2 trellis
of xyplots, using different symbols for the different values of factor
C. In addition, I'd like each of the ten panels to include a 1:1 line.
I know this would require a special panel function, but I don't know
what it should look like. I would much appreciate help in creating it.
Thank you.
David Parkhurst
How about this (untested) code:
xyplot(y ~ x | A * B, data = mydata, groups = C,
panel = function(x, y, subscripts, groups, ...) {
panel.superpose(x, y, subscripts, groups, ...)
panel.abline(0, 1)
}, layout = c(2, 5))
Here "mydata" is a data.frame with columns "x", "y", "A", "B", and "C".
--sundar
|