Skip to content
Back to formatted view

Raw Message

Message-ID: <CADX6M3rix++5_FvS3HNXXHJuA_fxeaZx9XkGF0YMvn8SohkwTQ@mail.gmail.com>
Date: 2013-07-04T21:53:24Z
From: Shaun Jackman
Subject: Lattice barchart with error bars

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