But first, a crash course on using ChatGPT in R - by Julian Schüssler
Then, we’re covering quite some ground regarding ggplot and its wider universe.
Recap basic concepts: Data, Aesthetics, Layers
Recap basic concepts: Facets, Scales, Coordinate Systems
Combining plots using {patchwork}
Plotting models
Practice: plot your own data / Recreate the plot challenge
To cover the basic ground, we’re going through two slidedecks by the brilliant Cedric Scherer.
This is not because I’m lazy, but just because anything I’d done myself would have been worse than these beautiful slides.
Link for slide deck 1: https://rstudio-conf-2022.github.io/ggplot2-graphic-design/materials/02_concepts_pt1.html
Link for slide deck 2: https://rstudio-conf-2022.github.io/ggplot2-graphic-design/materials/03_concepts_pt2.html
Component | Function | Explanation |
---|---|---|
Data |
ggplot(data)
|
The raw data that you want to visualise. |
Aesthetics |
aes()
|
Aesthetic mappings between variables and visual properties. |
Geometries |
geom_*()
|
The geometric shapes representing the data. |
Statistics |
stat_*()
|
The statistical transformations applied to the data. |
Scales |
scale_*()
|
Maps between the data and the aesthetic dimensions. |
Coordinate System |
coord_*()
|
Maps data into the plane of the data rectangle. |
Facets |
facet_*()
|
The arrangement of the data into a grid of plots. |
Visual Themes |
theme() and theme_*()
|
The overall visual defaults of a plot. |
from: Cedric Scherer https://rstudio-conf-2022.github.io/ggplot2-graphic-design/