owned this note
owned this note
Published
Linked with GitHub
---
tags: workshops
---
# Intermediate/Advanced `ggplot2` Workshop Series 2023
###### tags: `ggplot2`, `workshop`, `teaching`
Ideas for possible learning objectives and specific coding skills/functions/packages
## Title & Description
**Series Title:** Unlocking the full potential of ggplot2
:::spoiler Other title ideas:
- "How to (learn to) do almost anything with ggplot2"
- "How to (learn to) make almost any data visualization with ggplot2"
- "Learn to make almost any data visualization with ggplot2"
- "Level-up your `ggplot2` skills"
- "Unlocking the full potential of ggplot2"
- "Understanding, customizing, and leveling up your data visualization using ggplot2"
:::
### Email message
[Workshop series on 'ggplot2'](https://drive.google.com/file/d/1GaEm_EncM7spvHAnlGXMCwXyKqriOMVE/view?usp=share_link)
**Time:** June 5, 12, 26 (Mondays) from 11 am to 1 pm
**Location:** Zoom
**Description:** In this 3-part series, we will help you to unlock the full power of `ggplot2` functionality so you can create beautiful visualizations from start to finish without any manual editing. You'll learn to plot multiple data sets, customize the appearance of your plots, and harness advanced features with ggplot2 extensions.
**Prerequisites:** Recent versions of R and RStudio installed. Familiarity working with R and RStudio. Some familiarity with making plots using the `ggplot2` package in R (e.g. you've gone through Jeff Oliver's [ggplot2 materials](https://jcoliver.github.io/learn-r/004-intro-ggplot.html).
### Slack message
Hey there! CCT Data Science is teaching a 3-part series on intermediate ggplot in June.
We will help you to unlock the full power of `ggplot2` functionality so you can create beautiful visualizations from start to finish without any manual editing. See ad for details.
(attach pdf as file, which shows up in the preview)
## Workshops in Series
### 1. Understanding the foundations of `ggplot2`
**Instructor:** Jessica
**Description:**
In this workshop you'll gain a better understanding of the "grammar of graphics"---the theory underlying the `ggplot2` package. Using practical examples, you'll learn how understanding the grammar of graphics can help you build more creative, complex, information-rich visualizations.
**Learning Objectives:**
- Understand what the grammar of graphics is and how it relates to `ggplot2`
- Navigate `ggplot2` documentation
- Plot different layers together such as raw data alongside data summaries (e.g. dotplot with mean + SD) or model output (e.g. fitted line with ± 95% CI)
- Understand the difference between `stat_`s and `geom_`s and use appropriately
- Understand what happens when you define aesthetics inside `aes()` vs outside `aes()`
- Add annotations to a plot
[Registration](https://arizona.zoom.us/meeting/register/tZ0scuGoqz4jE9TSJcI5u2tkeZKeOIQE3_Ip)
**Notes:**
This will work well if driven by an example---e.g. a bar plot with raw data and ± CI plotted, and significance asterisks (or some other annotation)
- [Grammar of Graphics](https://ggplot2-book.org/introduction.html#what-is-the-grammar-of-graphics)
- Go through help files for geoms and show aesthetics section
- `stat_summary()` might be a good `stat_` for this example
- [`after_stat()`](https://ggplot2.tidyverse.org/reference/aes_eval.html) Maybe good to include?? There's an example for using it to label bars on a bar plot, but not sure it's better than doing it any other way. Best examples are for histograms
### 2. Crafting Publication Quality Data Visualizations With `ggplot2`
**Instructor:** Eric
**Description:**
"If you know how to make basic plots with `ggplot2`, but struggle to add on finishing touches like customizing colors, adding text to plots, and creating multi-plot figures, then this is for you"
**Learning Objectives:**
- Customize color palettes with accessibility in mind
- Customize appearance of plots with themes
- Customizing axes (ticks, gridlines, labels, date axes, transformations)
- Create custom legends
- Save high resoultion or vector formats
- Arrange multi-panel figures
[Registration](https://arizona.zoom.us/meeting/register/tZctcO-pqzwsE9Au30Ioc9EHycuL6jer7UqE)
**Notes:**
Show final product at beginning, discuss what customizations are needed, go through them. Participants can either re-create exactly or make their own plot.
- https://rpubs.com/mclaire19/ggplot2-custom-themes
- Coloring columns of wide data per geom with `color = "colname"` outside of `aes()` ?
- `key_glyph = `
- Combining legends (e.g. for `shape` and `color`)
- Demo the 4(?) different ways to remove a legend in `ggplot2` (??)
### 3. Exloring The Wide World of `ggplot2` Extensions
**Instructors:** Eric & Kristina
**Description:**
There are over 100 packages that extend the functionality of `ggplot2` to allow you to make just about any data visualization you can think of! In this workshop we'll cover a few of our favorite extensions and show you how to find the `ggplot2` extension that meets your data visualization needs.
**Learning Objectives:**
- Show [ggplot2 extensions gallery](https://exts.ggplot2.tidyverse.org/gallery/) and [Awesome ggplot2](https://github.com/erikgahner/awesome-ggplot2)
- Animated plots (with `gganimate`)
- Build up [example](https://www.datanovia.com/en/blog/gganimate-how-to-create-plots-with-beautiful-animation-in-r/) w/ gapminder
- Interactive charts (`plotly::ggplotly()` vs more complicated use cases with `ggiraph`)
- Maps maybe?
- Other extension packages (`ggforce::facet_zoom`)
- `ggrepel`, `gghighlight`?
- `ggtext`?
- Mention `patchwork`
- Random cool ones: `ggpattern`, `ggpol`
- `esquisse`: point and click tool for interactive data exploration, produces corresponding code; can embed in Shiny app
- Exercises? Recreate a plot using extensions that we haven't covered
[Registration](https://arizona.zoom.us/meeting/register/tZAoceGqqDsoHN1pWjtv_k0IQoanEbsRSaNj)
**Notes:**
get ideas of what people want to see in this workshop from feedback on the first two
## Relevant Coding Skills (in no particular order for now)
- [`patchwork`](https://patchwork.data-imaginist.com/) or [`cowplot`](https://wilkelab.org/cowplot/index.html) (*Eric*: I think `patchwork` is easier to learn and usually does a better job aligning plots)
- `stat_summary()`
- `theme()`
- `scale_color/fill_*()`
- https://ggplot2-book.org/scales-guides.html
- `scale_x/y_*()`
- `coord_*()`
- `after_stat()`
- mixing datasets in a single plot with `data=` and `inherit_aes=`
- [`ggforce`](https://ggforce.data-imaginist.com/)
- [`ggpubr`](https://rpkgs.datanovia.com/ggpubr/)
- [`gganimate`](https://gganimate.com/)
- [ggplot2 extensions gallery](https://exts.ggplot2.tidyverse.org/gallery/)
- [`key_glyph =`](https://ggplot2.tidyverse.org/reference/draw_key.html) (for customizing legends)
- `ggsave()`
## Other learning objectives that didn't make the cut
- writing alt-text for data visualizations
- Plotting polar coordinates (radar plots, donut plots, seasonal data, directional data)