[R] displaying sample size in boxplots

Patrick Drechsler
2004-09-29T12:46:41Z

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)

TIA,

Patrick
--
"What happens if a big asteroid hits Earth ? Judging from
 realistic simulations involving a sledge hammer and a common
 laboratory frog, we can assume it will be pretty bad."
                                                -- Dave Barry