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

Deepayan Sarkar deepayan.sarkar at gmail.com
Thu Aug 13 19:12:56 CEST 2009


On Wed, Aug 12, 2009 at 7:19 AM, <amvds at xs4all.nl> wrote:
> Thank you Gerrit,
>
> Your suggestion proved right after all:
>
> This does put error bars (dy) on the points. You only need to figure out
> the proper y axis scaling.
>
>> xyplot(y~x|f,data=xy,groups=dy,panel=function(x,y,groups,subscripts,...)
> {panel.xyplot(x,y,...)
> ;panel.segments(x,y+groups[subscripts],x,y-groups[subscripts],...)})

You might also want to check out the segplot function in latticeExtra
(it has a few rough edges, but should mostly work).

-Deepayan




More information about the R-help mailing list