[R] xyplot: Can I identify groups but not use them for regression?

2009-09-18 Thread Seth W Bigelow
I wish to identify groups representing different treatments, but to plot them and do a regression using a continuous variable (cover) ignoring the groupings. d$year - NA d$year -c(rep(2007,12), rep(2008,12)) d$treatment - c(rep(A,4),rep(B,4),rep(C,4), rep(A,4), rep(B,4), rep(C,4)) d$cover -

Re: [R] xyplot: Can I identify groups but not use them for regression?

2009-09-18 Thread Sundar Dorai-Raj
I think this ought to work for you: library(lattice) set.seed(42) d - data.frame(year = c(rep(2007,12), rep(2008,12)), treatment = rep(LETTERS[1:3], each = 4, times = 2)) d$cover - rnorm(nrow(d)) d$variable - rnorm(nrow(d)) xyplot(variable ~ cover | year, d, panel =

Re: [R] xyplot: Can I identify groups but not use them for regression?

2009-09-18 Thread Peter Ehlers
And if you make 'year' a factor with levels '2007' and '2008' you'll get your second wish. Peter Sundar Dorai-Raj wrote: I think this ought to work for you: library(lattice) set.seed(42) d - data.frame(year = c(rep(2007,12), rep(2008,12)), treatment = rep(LETTERS[1:3], each =