[R] Dotchart showing mean and median by group
Gabor Grothendieck
ggrothendieck at gmail.com
Wed May 9 15:20:31 CEST 2012
On Wed, May 9, 2012 at 3:25 AM, maxbre <mbressan at arpa.veneto.it> wrote:
> Given this example
>
> mean.values<-colMeans(VADeaths)
>
> mean.values<-apply(VADeaths, 2, mean)
> median.values<-apply(VADeaths, 2, median)
>
> dotchart(VADeaths, gdata=mean.values)
> dotchart(VADeaths, gdata=median.values)
>
> is it possible to “combine” a single dotchart showing both the mean and the
> median for each single group (with different plotting symbols)?
>
Try this:
dotchart(VADeaths, gdata=mean.values)
par(new = TRUE)
dotchart(VADeaths, gdata=median.values, gpch = 20)
--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com
More information about the R-help
mailing list