Layer fundamentals: from user to potential extender
Gina Reynolds: ggplot2 extenders education
To start building a plot, you need to define the data and the variable encoding (i.e. what visual channels – color, x position, size etc – should represent your variables.)
library(ggplot2) ggplot(mpg) +aes(x = hwy, y = cty) +theme_gray(base_size =18)