On Fri, Aug 20, 2010 at 4:03 PM, array chip <arrayprof...@yahoo.com> wrote: > What a simple way to do what I want to do! Thanks. > > But if there is missing data in variable "y", then the averaged lines is > broken > where the missing data is present. For example: > > dat$y[c(10,185,200,400,450)]<-NA > > then using type='a' option will result in broken lines. > xyplot(y~day|sex, groups=trt, data=dat, type=c('p','g', 'a')) > > I was able to solve this using panel.superpose() and panel.average(). But it's > too much syntax. Is there a simpler way to do this?
Omit the NA rows from your dataset beforehand: e.g., xyplot(y~day|sex, groups=trt, data=na.omit(dat), type=c('p','g', 'a')) or xyplot(y~day|sex, groups=trt, data=dat[!is.na(dat$y), ], type=c('p','g', 'a')) -Deepayan ______________________________________________ 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.