David Afshartous
2008-Jul-25 19:50 UTC
[R] Pairs() function: selective changing of ylim; use of key
All,
Two questions RE scatterplot matrices produced via pairs() function:
1) Is it possible to selectively change the ylim of one of the subplots?
2) Is a key allowed? I don't seem to be able to insert a manual key.
Code below:
dat = data.frame(Hour= rep(c(0:3), 4), Y1 = rnorm(16,1),
Y2 = rnorm(16,4),Drug = rep(c("P", "D"), each=4, 2) )
## this works:
pairs(dat, pch = 21, bg = c("red",
"green3")[unclass(dat$Drug)])
## this produces several warnings:
pairs(dat, pch = 21, bg = c("red",
"green3")[unclass(dat$Drug)],
key = list(space = "top", text = levels(dat$Drug), lines
list(col=c("red", "green3")), columns=2) )
Cheers,
David