[R] displaying sample size in boxplots

Stefano Calza stecalza at tiscali.it
Wed Sep 29 17:39:01 CEST 2004


On Wed, Sep 29, 2004 at 08:08:19AM -0500, Marc Schwartz wrote:
> On Wed, 2004-09-29 at 07:46, Patrick Drechsler wrote:
> > Hi,
> > 
> > I was wondering if there is a ready made function or parameter
> > for indicating the sample size in boxplots?
> > 
> > Here's what I came up with so far:
> > 
> > library(ISwR)
> > data(energy)
> > attach(energy)
> > boxplot(expend~stature)
> > sample.size <- tapply(expend, stature, length)
> > sample.size <- paste("N=", sample.size, sep="")
> > mtext(sample.size, at=1:length(unique(stature)), line=2, side=1)
> 

In vol 3/2 October 2003 of R news there's an extended version of boxplot, with median and mean ticks, etc. and also sample dimension.

HIH,
Stefano

> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list