0

My boxplot looks great, but I'd like to print on it how many samples make up each category as well as the upper and lower limit and mean

My boxplot is coded as follows:

boxplot(rainbow$CN~rainbow$IM,outline=FALSE,col=c("red","green","black"))

The dataframe this comes from is:

IM        CN
yes       3
no        12
yes       1
no        4
yes       9
Sebastian Zeki
  • 6,690
  • 11
  • 60
  • 125
  • 1
    Here is [ggplot solution](http://stackoverflow.com/questions/15660829/how-to-add-a-number-of-observations-per-group-and-use-group-mean-in-ggplot2-boxp) – zx8754 Apr 15 '15 at 08:24
  • You could label it like this: `res <- boxplot(rainbow$CN~rainbow$IM); with(data.frame(x = 1:ncol(res$stats), y = as.vector(t(res$stats))), text(x, y, y))`. – lukeA Apr 15 '15 at 09:02
  • Also just found out that boxplot2 will give the number of elements in each boxplot – Sebastian Zeki Apr 17 '15 at 09:34

0 Answers0