Introduction to Boxplots explains what a box shows. Draw one per group, then compute what a box is made of.

The InsectSprays dataset counts insects after six sprays, A to F. The program reads one spray letter.

  1. With ggplot2, draw a boxplot of count for every spray, and print() it.
  2. For the spray that was read, print its median and its interquartile range (IQR()), and how many of its counts boxplot.stats() marks as outliers:

For spray A:

Median: 14
IQR: 6.25
Outliers: 0

Hint: boxplot.stats(x)$out holds the outliers.

Which sprays are clearly more effective? Can you see it in the boxes before you compute anything?

Run draws your plot under the output. Check and Submit test the numbers your program prints.

You do not have permission to attempt this activity.