Week 3: ggplot2
Lectures
- 3.1 ggplot2: The Grammar of Graphics(PDF)
- 3.2 ggplot2: Geoms(PDF)
- 3.3 ggplot2: Facets, Themes, and Saving(PDF)
- ggplot2 cheat sheet (Posit)
Labs
- Lab 3: Graphics with ggplot2(PDF)
- Lab 3 solutions (password)
Additional readings
- R for Data Science: Data visualisation
- Tidyverse Style Guide: ggplot2
- Posit Primer: Visualize data
- A ggplot2 tutorial for beautiful plotting in R
Discussion
- Pick a plot from the news. What are the data, the geom, and the aesthetic mappings?
- What is the difference between mapping color inside
aes()and setting color outside it?