Boxplots in Base R
R base box plots: boxplot()
Draw a box plot of teeth length (len):
Basic box plots
# Box plot of one variable boxplot(ToothGrowth$len) # Box plots by groups (dose) # remove frame boxplot(len ~ dose, data = ToothGrowth, frame = FALSE) # Horizontal box plots boxplot(len ~ dose, data = ToothGrowth, frame = FALSE, horizontal = TRUE) # Notched box plots boxplot(len ~ dose, data = ToothGrowth, frame = FALSE, notch = TRUE)
Notch is used to compare groups. In the notched boxplot, if two boxes' notches do not overlap this is "strong evidence" their medians differ (Chambers et al., 1983, p. 62).