Click image to download PDF
For a given data set, a five-number summary consists of:
- The median of the data
- The upper and lower quartiles of the data
- The minimum value of the data
- The maximum value of the data
as a function of . In other words, for all we have:
How do we combine these two different size data sets into a data frame?
With the ply package installed, you call it using the library command library(plyr).
and then uses r.bind() to combine these two modified data sets into a single data frame.
> boxplot(combined, ylab=”Birthweight(ounces)”, col=c(“royalblue2″,”red”))
Here we have colored the boxes differently for visual distinction, and labelled the vertical axis.
Box-plot with R – Tutorial from R Bloggers, by Fabio Veronesi