Graphics Reference
In-Depth Information
Figure 6-1. A basic histogram
Discussion
All
geom_histogram()
requires is one column from a data frame or a single vector of data. For
this example we'll use the
faithful
data set, which contains data about the Old Faithful geyser
in two columns:
eruptions
, which is the length of each eruption, and
waiting
, which is the
length of time to the next eruption. We'll only use the
waiting
column in this example:
faithful
eruptions waiting
3.600
79
1.800
54
3.333
74
...