Artwork by Allison Horst
Pre-class Prep
A. Install required packages
install.packages("monochromeR") # a package for creating monochrome color palettes and easily converting rgba values to hex codes (and also some other useful functions)
install.packages("showtext") # for using fonts more easily in R graphs
install.packages("ggtext") # improved text rendering support for ggplot2
install.packages("ggrepel") # ggplot2 extension to repel overlapping labels
install.packages("googlesheets4") # provides an R interface to Google Sheets via the Sheets API v4
B. Download Font Awesome fonts
We’ll learn how to use Font Awesome icons in our ggplots. To do so, you’ll need to download the Font Awesome font files and save them to your class repo. Do so by following these steps:
- Download Font Awesome fonts: Go to https://fontawesome.com/download and download the latest release available. Choose the Free For Desktop option.
- Unzip the downloaded file: You should see a folder inside called
otfs/
– this contains three.otf
files (aka OpenType font format files) - Copy the three
.otf
files to your class repo: I recommend creating afonts/
folder inside your root directory, and dropping all three of them in there (e.g.~/fonts/*.otf
)
C. Download .qmd templates & review data wrangling code
Download all necessary templates (links in the table below) and save them to a
EDS-240-data-viz-examples/week6/
folder.Review setup / wrangling / base plot code and make note of any questions you might have. Due to time constraints, we won’t be live-coding our way through all code in class. However, we’ll reserve some time to answer any questions before we jump into data viz . Specifically:
- Template 6.1 begins where we left off in creating our salary plot (in lecture 4.1). Review the code under the
## Setup
,## Wrangle Data
and## Recreate original plot
sections to re-familiarize yourself.
- Template 6.2 includes setup and base plot code for two different visualizations (one using lobster data, another using Mono Lake data). Review the
### Setup
and### Create base plot
sections for both these visualizations.
- Template 6.1 begins where we left off in creating our salary plot (in lecture 4.1). Review the code under the
Lecture Materials
Lecture slides | Code-along template | Code-along key |
---|---|---|
Lecture 6.1: typography | 6.1 template | 6.1 key |
Lecture 6.2: annotations | 6.2 template | 6.2 key |
Pre-discussion Prep
A. Prepare a week6-discussion.qmd
file
Add a new blank file to your class repo at the following location:
EDS-240-class-examples/week6/week6-discussion.qmd.
Fill out the necessary YAML information (title, author, date + any other information you find helpful).Copy over the contents from your
TEMPLATE-lecture6.1-typography.qmd
file – we’ll be iterating on this code during discussion section.
Discussion Materials
Discussion Slides | Exercise instructions | Exercise solutions |
---|---|---|
D6 slides: saving plots | see pre-discussion prep | see D6 slides |
Assignment Reminders
Assignment Type | Assignment Title | Date Assigned | Date Due |
---|---|---|---|
EOC | EOC (week 6) | Mon 02/10/2025 | Mon 02/10/2025, 11:55pm PT |
HW | Homework Assignment #3 | Tue 02/11/2025 | Tue 02/25/2025, 11:59pm PT |