[R] Adding error bars to xyplot()

Deepayan Sarkar deepayan.sarkar at gmail.com
Sun Apr 25 05:53:14 CEST 2010


On Fri, Apr 23, 2010 at 12:56 PM, Jon Zadra <jrz9f at virginia.edu> wrote:
> I took a look at xYplot() but it is beyond over-complex, at least for my
> level, and the documentation isn't too clear.
>
> Is there a simple way to make functions like plotCI() and errbar() use the
> lattice reference rather than base graphics?
>
> It seems like creating a plot of two lines across three time points
> separated into two groups should be a very basic, simple thing for a
> statistics program to do.  Is there really no way to simply pass a model to
> a plotting function and get something that includes error bars?  I just
> wonder if I"m missing how to do this "the easy way."

Try ?segplot in package latticeExtra. E.g.,

require(latticeExtra)
segplot(interaction(group, time) ~ (means-SE) + (means+SE), centers = means,
        horizontal = FALSE, draw.bands = FALSE)

YMMV.

-Deepayan



More information about the R-help mailing list