On Sat, Aug 23, 2008 at 1:10 PM, Michael Kubovy <[EMAIL PROTECTED]> wrote: > Dear Juliet, > > Perhaps start here: > > require(lattice) > mwpp <- data.frame(y = c(43,42,26,39,60,60,46,40,41,36,42,54, > 58,43,46,56,81,56,70,70,44,52,81,59,69,68), > sex = rep(c(rep('men', 14), rep('women', 12))), > pp = c(rep(c('pre', 'post'), each = 7), rep(c('pre', 'post'), each = > 6)), > sub = c(1:7, 1:7, 8:13, 8:13))
Or in ggplot2: library(ggplot2) qplot(pp, y, data=mwpp, geom=c("point","line"), group = sub, colour=sex) qplot(pp, y, data=mwpp, geom=c("point","line"), group = sub, facets = . ~ sex) The key is to get your data into a data frame with variables that explicitly label the experimental units, as Michael did for you. Hadley -- http://had.co.nz/ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.