Histogram

Want to learn more? I recommend working through: R for Data Science, R Cookbook, and R Graphics Cookbook.

# load the ggplot2 package
library(ggplot2)
# hisotogram of the mpg variable from the mtcars dataset
ggplot(mtcars, aes(x=mpg)) + geom_histogram(binwidth=4)

png