## The Box and Whisker Plot from Collaborative Stats (Example 2.9) # First, the data: heights = c(59, 60, 61, 62, 62, 63, 63, 64, 64, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 66, 66, 67, 67, 68, 68, 69, 70, 70, 70, 70, 70, 71, 71, 72, 72, 73, 74, 74, 75, 77) # Let's check the summary of the data (we don't need this for the plot): summary(heights) # Then the plot: boxplot(heights) # We always need labels. "main" gives the title and ylab labels the y-axis boxplot(heights, main="Heights of Students in a Stats Class", ylab="Height (inches)") # Let's lie it on its side: boxplot(heights, main="Heights of Students in a Stats Class", xlab="Height (inches)", horizontal=TRUE)