This is a workshop written for UCSB MEDS Winter 2023, EDS 240 (Data Visualization and Communication) given on 2 March 2023.
# general use
library(tidyverse) # general tidying and visualization: ggplot is loaded by default with tidyverse
library(lterdatasampler) # data we're using comes from this package
library(lubridate) # working with dates
library(here) # folder organization
# extras
library(patchwork) # arranging plots
library(magick) # putting images into ggplots
The code template is here and knitted output is here.
For independent work time, you have a few different options:
Goal: understand how theme
options work and/or explore package add-ons to ggplot
Task: recreate Tidy Tuesday visualizations from week 8 (data on Bob Ross paintings). Treat this like a puzzle: you know the end result (the image), but all the pieces you have are in disarray (the theme
tools). Try working backwards from the output to see if you can recreate the plot.
See the document for visualizations to recreate.
Goal: improve visualizations from 1 Mar submissions to convey a message (not just showing the data)
Task: revisit the visualizations you submitted and consider two points:
- What message am I trying to convey with this figure?
- How can I convey that message?
Sometimes addressing 1) and 2) together mean taking things away (because your figure is too data-dense) or adding things in (because your figure is a map without data on it).
After you've answered 1) and 2) for yourself, write them down and sketch out the plot you would make to address both points. Remake your figure and ask someone to tell you what the main message is (without you telling them what you think it is). It's important that this person is not in your group and doesn't know the details of your group project.
You have already learned about different types of plots for different types of data: this is the Visual Vocabulary. You can also use this flow chart or directory of data visualizations. Additionally, you have learned about visual variables (see lecture slides from 26 Jan).
If you're stuck, you can also revisit the mapping activity we did in class during week 4. With your group mates, you wrote down the kinds of visualizations you wanted to make and the visual variables you would manipulate in each visualization.
Goal: incorporate feedback into a revised evaluation plan
Task: meet with your group members and carefully consider feedback you have received. As with any feedback: if you agree, incorporate it into your plan; if you disagree, add justification (in text or otherwise) for why you do not need to incorporate that feedback and context for why that feedback doesn't apply to you.