penguins |>
filter(!is.na(flipper_length_mm), !is.na(body_mass_g)) |>
ggplot(aes(x = flipper_length_mm, y = body_mass_g)) +
geom_point(alpha = 0.6) +
labs(x = "Flipper length (mm)", y = "Body mass (g)") +
theme_minimal()Day 1 Activity: Reading Data Graphics
Activity: Reading Data Graphics
You won’t write much code today. Instead, the goal is to read plots effectively to figure out what question each one is answering, what works, and what doesn’t.
Take 20 minutes for this activity.
Setup:
- Open RStudio.
File > New File > Quarto Document...(or open the.qmdposted to Canvas).- Save it as
day1-activity.qmdsomewhere you’ll find it later. - Add a setup chunk like the one at the top of this document.
Write your answers in the same .qmd. Use Markdown headings (##) to keep your sections labeled.
Part 1 — Match the question to the graphic (5 min)
For each question, write down which of the five genres you’d use: scatter plot, histogram, bar chart, map, or network.
- “Do students who sleep more tend to have higher GPAs?”
- “Which Big Ten football team has the most wins this season?”
- “How is rent distributed across one-bedroom apartments in State College?”
- “Which counties in Pennsylvania voted most heavily for the winning candidate in 2024?”
- “Among Taylor Swift collaborators, which artists have worked together?”
- “Are there more underweight, normal, or overweight cats at the local shelter?”
Part 2 — Critique these plots (10 min)
Each chunk below makes a plot from the penguins dataset. Run each one, look at the output, and write 2–3 sentences answering:
- What question is this plot trying to answer?
- Does it answer that question well? What’s good or bad about it?
- Would a different genre work better? If so, which one?
Write your answers underneath each plot in your .qmd.
Plot A
Your answer:
Plot B
penguins |>
filter(!is.na(bill_length_mm)) |>
ggplot(aes(x = bill_length_mm)) +
geom_histogram(bins = 30, fill = "#7C0A02", color = "white") +
labs(x = "Bill length (mm)", y = "Count") +
theme_minimal()Your answer:
Plot C
penguins |>
filter(!is.na(species), !is.na(island)) |>
count(species, island) |>
ggplot(aes(x = species, y = n, fill = island)) +
geom_col(position = "dodge") +
labs(x = NULL, y = "Count", fill = "Island") +
theme_minimal()Your answer:
Plot D
penguins |>
filter(!is.na(body_mass_g)) |>
ggplot(aes(x = species, y = body_mass_g)) +
geom_point() +
labs(x = NULL, y = "Body mass (g)") +
theme_minimal()Your answer: (Hint: this technically works, but a different geom would tell the story much better. Which one?)
Part 3 — Find a plot in the wild (5 min)
Open up a news site, a sports site, a Wikipedia article, or anywhere with a real graphic. Examples to try:
- eBird Status and Trends;
- New York Times Graphics Spotlight;
- R Graph Gallery;
- RAND Visualizations Page;
- Pew Research Center Favorite Data Visualizations of 2025;
- ESPN Analytics;
- Spurious Correlations;
- Python Graph Gallery;
- Silver Bulletin;
- The Pudding.
Pick one plot you find. In your .qmd, write:
- A link or description of the plot.
- Which of the five genres it belongs to (or whether it’s a hybrid).
- What question it answers in one sentence.
- One thing it does well. (Clear labels? Good color choice? Reveals a pattern?)
- One thing you’d change. (Misleading axis? Too many categories? Cluttered?)
Wrap-up
- Render your
.qmd(Cmd/Ctrl + Shift + K) and make sure it knits without errors. - Check that your answers are written under each plot in plain English, not just stuck in code comments.
- Save both the
.qmdand the rendered HTML.
To turn in: Upload your .qmd and HTML to Canvas before the end of class.
If you finish early:
- Try changing one of the plots above to a different genre. Does the new version answer a different question?
- Look up the
geom_boxplot()function. Where would it fit in our five genres? - Pull up a graphic from your own social media feed (Instagram story polls, Spotify Wrapped, a YouTube analytics chart) and answer the same five questions about it.
