Re: [R] how to generate bar charts with the standard deviation

From: Marc Schwartz <>
Date: Thu, 13 Mar 2008 10:31:32 -0500

Ng Stanley wrote:
> Hi,
> I have the two vectors mean and sd of individual columns, but I am unsure
> how to generate bar charts with the standard deviation, even after looking
> the help of barplot and barplot.2.

Barplots are not well suited for presenting continuous data and many would argue that even for proportions, they should not be used to present CI's.

You are better off using:

  1. plotCI() in the gplots package:

2. plotmeans() in the same, which is a wrapper to the above:

3. errbar() in the Hmisc package:

4. arrows() and/or segments() in the default R installation, which can be used like errbar() to add CI's to points.

HTH, Marc Schwartz mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 13 Mar 2008 - 15:34:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 13 Mar 2008 - 16:30:21 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive