[R] Plot means with error bars - A novice needs help

Manuel Morales Manuel.A.Morales at williams.edu
Wed Oct 8 21:38:25 CEST 2008


On Wed, 2008-10-08 at 09:49 -0700, Dylan Beaudette wrote:
> On Wednesday 08 October 2008, Manuel Morales wrote:
> > Another option is bargraph.CI or lineplot.CI from the package sciplot.
> >
> > See http://mutualism.williams.edu/sciplot for examples.
> >
> > On Tue, 2008-10-07 at 23:31 -0500, Michael Just wrote:
> > > Hello,
> > > I'd appreciate a suggestion on how to construct plots (barplots?) that
> > > use means on the Y axis instead of density/count. I'd also like to use
> > > groups and plot error or confidence interval bars on these graphs. I know
> > > this is a read the manual situation. I'd appreciate help with what to
> > > read, or your benevolence with some sample code.
> > >
> > > I've looked at lattice and gplots2, but given my beginner status my
> > > efforts are not propelling me very far.
> > >
> > > Thank you kindly,
> > > Michael Just
> 
> # Personally, this looks more informative to me:
> library(lattice)
> bwplot(len ~ supp | factor(dose), data=ToothGrowth, layout=c(3,1))
> 
> # and some people like this:
> require(Hmisc)
> bwplot(supp ~ len | factor(dose), data=ToothGrowth, layout=c(3,1), 
> panel=panel.bpplot, datadensity=TRUE)

I guess personal preference but I prefer a layout that has them
overlapping - visual comparison is easier. 

E.g.:
require(sciplot)
lineplot.CI(response=len, x.factor=dose, group=supp, data = ToothGrowth)

If detail of the distributions are needed, the graphs you suggest are
certainly warranted!
> 
> 
-- 
http://mutualism.williams.edu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20081008/851c00ce/attachment.bin>


More information about the R-help mailing list