12.9 Histogram using ggplot2
We also create a histogram with the PM2.5 values using the ggplot() function of the ggplot2 package.
library(ggplot2)
ggplot(data = map@data, aes(x = PM2.5)) + geom_histogram()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 11 rows containing non-finite values (`stat_bin()`).