Re: [R] xyplot plot with groups

2010-08-21 Thread Deepayan Sarkar
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

[R] xyplot plot with groups

2010-08-20 Thread array chip
Hi, I am a beginner of xyplot() (or lattice package). On one hand, I immediately realized it's a very powerful utility. On the other hand, there are too many things for me to learn. Still haven't figure out a generalization of the syntax and usage under many different circumstances. Let me

Re: [R] xyplot plot with groups

2010-08-20 Thread Dennis Murphy
Hi: Like this? xyplot(y~day|sex, groups=trt, data=dat, type=c('p','g', 'a')) The 'a' stands for average line, or 'connect the averages at different x values'. By using the groups = trt argument, you get one line per treatment group in each panel. A complete list of valid types is given on p.

Re: [R] xyplot plot with groups

2010-08-20 Thread array chip
:3), panel.groups=function(...) panel.average(..., fun=function(x) mean(x,na.rm=T),horizontal=F))}) Thanks John From: Dennis Murphy djmu...@gmail.com Cc: r-help@r-project.org Sent: Fri, August 20, 2010 3:25:06 PM Subject: Re: [R] xyplot plot with groups