Skip to content

plotmeans in trellis view?

2 messages · DougB, Sam Albers

#
I'm not sure about "plotmeans" but this is usually the way I plot means with
lattice:

library(lattice)
x <-  runif(48, 2, 70)
data <- data.frame(x)
data$factor1 <- factor(c("A", "B", "C", "D"))
data$factor2 <- factor(c("X", "Y", "Z"))
data.mean <- with(data, aggregate(data$x, by=list(factor1=factor1,
factor2=factor2), mean))
with(data.mean, xyplot(x~factor1 | factor2))

Is this sort of what you were looking for?

HTH,

Sam