[R] boxplot and number of observations per box

David Hewitt dhewitt37 at gmail.com
Wed Jan 30 18:15:24 CET 2008




> How can I plot the number of observations per box in a boxplot.
> 

As usual, there's probably a more elegant solution, but this will do it:

p <- rnorm(100)
diddy <- boxplot(z)
text(1, diddy$stats[3]+0.4, paste("n = ", diddy$n))

see ?text and ?boxplot

-----
David Hewitt
Virginia Institute of Marine Science
http://www.vims.edu/fish/students/dhewitt/
-- 
View this message in context: http://www.nabble.com/boxplot-and-number-of-observations-per-box-tp15180615p15186107.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list