On Fri, Aug 20, 2010 at 4:03 PM, array chip 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=
7;), panel=function(...)
{panel.xyplot(...);
panel.superpose(..., col=c(1:3), panel.groups=function(...)
panel.average(..., fun=function(x) mean(x,na.rm=T),horizontal=F))})
Thanks
John
From: Dennis Murphy
Cc: r-help@r-project.org
Sent: Fri, Augus
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. 75
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 giv
4 matches
Mail list logo