>> How can I add the mean and standard deviation to each of the boxplots using the example provided in the boxplot function? boxplot(len ~ dose, data = ToothGrowth) #You could add the mean as a point points(tapply(len, dose, mean), col="red")
Alternatively, replace the median value with the mean, by writing a replacement for fivenum that calculates mean instead of median, then call bxp instead of boxplot. As for the standard deviation, are you sure you want this? Standard deviation only makes sense if the data are normally distributed, and boxplots are typically used to examine how the data are distributed (i.e., if you knew they were normally distributed already, you wouldn't need to draw the boxplot). Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}} ______________________________________________ R-help@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.