Re: [R] Lattice: How to do error bars

2009-08-22 Thread Deepayan Sarkar
On 8/11/09, Alex van der Spek wrote: > I am trying to add 2 stdev error bars to lattice type plots: > > panel.ebar<-function(x,y,dy=NULL,...) { > panel.xyplot(x,y,...) > panel.segments(x,y-dy,x,y+dy,...) > } > > Then: > > xyplot(y~x|fc,data=dat,dy=dat$dy,panel=panel.ebar) > >

[R] Lattice: How to do error bars

2009-08-11 Thread Alex van der Spek
I am trying to add 2 stdev error bars to lattice type plots: panel.ebar<-function(x,y,dy=NULL,...) { panel.xyplot(x,y,...) panel.segments(x,y-dy,x,y+dy,...) } Then: xyplot(y~x|fc,data=dat,dy=dat$dy,panel=panel.ebar) This adds error bars but they are not conditioned on the factor