[R] Lattice: How to do error bars

Alex van der Spek amvds at xs4all.nl
Tue Aug 11 11:42:10 CEST 2009

I am trying to add 2 stdev error bars to lattice type plots:

panel.ebar<-function(x,y,dy=NULL,...) {



This adds error bars but they are not conditioned on the factor fc.


This produces 3 series of points in different colors, conditioned on fc
as the data is now grouped per panel. 

Obviously I need a combination of the above two. I can't figure it out.

Any help? Just point to docs if avaiable. The R doc is excellent. Most
of the time I can save myself.

Thanks in advance!
Alex van der Spek

More information about the R-help mailing list