Skip to content
Prev 42716 / 398506 Next

Trellis graph and two colors display

You don't need to mess around with the subscripts argument for this. I think
the problem is that you are not passing the necessary graphical parameters
to your panel function. You could do:

dat <- expand.grid(ID = 1:4, mois = c(3, 9))
dat <- dat[rep(seq(nrow(dat)), rep(10, nrow(dat))), ]
dat <- data.frame(dat, x = rnorm(nrow(dat)), y = rnorm(nrow(dat)))
dat$ID <- factor(dat$ID)

lset(list(superpose.symbol = list(col = c("blue", "red"), pch = c(1, 1))))

xyplot(y ~ x | ID, data = dat,
       groups = mois,
       panel = function(x, y, ...) {
         panel.superpose(x, y, ...)
         panel.abline(lm(y~x), col = "green")
       })

Cheers,
Jim 

James A. Rogers 
Manager, Biometrics
PGR&D Groton Labs
Eastern Point Road (MS 8260-1331)
Groton, CT 06340
office: (860) 686-0786
fax: (860) 715-5445
 


LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}