Re: [R] panel function

From: Berton Gunter <gunter.berton_at_gene.com>
Date: Wed 21 Dec 2005 - 06:18:35 EST


You probably have missing values in your y data. Try: ...
panel.abline(h=mean(y,na.rm=TRUE))
...

"The business of the statistician is to catalyze the scientific learning process." - George E. P. Box    

> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Martin
> Henry H. Stevens
> Sent: Tuesday, December 20, 2005 10:30 AM
> To: r-help@stat.math.ethz.ch
> Subject: [R] panel function
>
> R v. 2.2.0 on Mac OS 10.4.3
> lattice v. 0.12-11
>
> I am trying to add a horizontal panel mean line to a series
> of panels
> in a trellis plot (i.e. a horizontal line at the mean of y for each
> individual panel). I have tried innumerable ways to do this,
> including the code below, but if it works at all, it merely puts a
> horizontal line in the last panel.
>
> xyplot(diss ~ Nut-7|Size, data=dathdiss, pch=1, jitter.data=TRUE,
> panel=function(x,y,...){
> panel.xyplot(x,y)
> panel.abline(a=mean(y),b=0) #This results in the
> correct line in the
> last panel, but no other lines at all.
> })
>
> Any and all thoughts are appreciated.
> Thank you kindly,
> Hank
>
> Dr. Martin Henry H. Stevens, Assistant Professor
> 338 Pearson Hall
> Botany Department
> Miami University
> Oxford, OH 45056
>
> Office: (513) 529-4206
> Lab: (513) 529-4262
> FAX: (513) 529-4243
> http://www.cas.muohio.edu/~stevenmh/
> http://www.muohio.edu/ecology/
> http://www.muohio.edu/botany/
> "E Pluribus Unum"
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Dec 21 06:40:17 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:40 EST