Introduction to ggplot2

library(ggplot2)

The first function you might start with is qplot(), short for quick plot. It behaves similarly to plot() but provides many more options.

qplot(displ, hwy, data = mpg)

plot of chunk unnamed-chunk-2

qplot(displ, hwy, data = mpg, colour = class)

plot of chunk unnamed-chunk-2