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 -
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 =
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 =
3 matches
Mail list logo