Practise the histogram ideas from Introduction to Histograms on the faithful dataset: eruption lengths of the Old Faithful geyser.

The program reads a suggested number of bins.

  1. Draw a histogram of faithful$eruptions with hist(), passing the number as breaks, with a title and axis label.
  2. hist() also returns what it drew. Print how many bins it actually used, and the count in the tallest bin:

For a suggestion of 10:

Bins: 8
Tallest bin: 75

Hint: h <- hist(...), then length(h$counts) and max(h$counts).

Try 5, 10 and 30 bins. Why does R not always use exactly the number you ask for? And what does the shape tell you about eruptions?

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.