The grammar of ggplot2 plots

The following ggplot template comes from the book R for Data Science by Garrett Grolemund & Hadley Wickham.

ggplot(data = <DATA>) + 
  <GEOM_FUNCTION>(
     mapping = aes(<MAPPINGS>),
     stat = <STAT>, 
     position = <POSITION>
  ) +
  <COORDINATE_FUNCTION> +
  <FACET_FUNCTION>

Each ggplot2 plot is a combination use of seven parameters as you can in the template.

Examples

ggplot(data = mtcars) +                           
  geom_point(mapping = aes(x = mpg, y = disp),  
             stat = 'identity',
             position = 'identity') +
  coord_cartesian() + 
  facet_grid(~am)