Skip to content
Back to formatted view

Raw Message

Message-ID: <CACk-te3dd3WUFpturf2rKHJkUKHHV8Uwrh4aM6yxd=9O9q1Erg@mail.gmail.com>
Date: 2013-07-04T22:30:14Z
From: Bert Gunter
Subject: Lattice barchart with error bars
In-Reply-To: <CADX6M3rix++5_FvS3HNXXHJuA_fxeaZx9XkGF0YMvn8SohkwTQ@mail.gmail.com>

Shaun:

I understand that this type of plot is standard in many disciplines,
but it really is awful (google on 'Dynamite plots' for some more
erudite perspectives). Have you considered bwplot() for your
unaggregated data instead?

(No need to reply. It's July 4, and I'm just waving a little flag for
better graphs).

Cheers,
Bert

On Thu, Jul 4, 2013 at 2:53 PM, Shaun Jackman <sjackman at gmail.com> wrote:
> Hi,
>
> I'd like to draw a lattice barchart of means with error bars to show
> the standard deviation. I have the barchart, how do I add the error
> bars?
>
> require(datasets)
> require(lattice)
> x <- aggregate(weight ~ Diet, ChickWeight, function(x) c(mean=mean(x),
> sd=sd(x)))
> barchart(weight[,'mean'] ~ Diet, x)
>
> Thanks,
> Shaun
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm