Week 38.2 — Data visualisation 2
Friday 18 September, 12:30–16:00
An Introduction to the layered grammar of graphics
In the this class, we will continue to learn the layered grammar of graphics as implemented in the ggplot2 📦
Find an example of a “bad” graphic. In the class your groups you will discuss what makes your individual graphs bad and select the worst graph to battle with the other groups for the title of “Worst graph 2026” and a small prize.
Upload your “bad” graphic to the Worst graph of 2026 discussion topic in Brightspace.
What you’ll be doing
In your groups you will discuss your “bad” graphs and what it is that makes them “bad”. You group will select its worst graph and enter it into competition against the the other groups for the title of “Worst visualisation, 2025”. A prize for the worst graph will be awarded.
Following the worst graph competition we’ll look in a little more detail at some other graph types, which use ggplot’s stats system to transform data before it is plotted.
Finally, you’ll use some of the data sets that we have encountered so far in the course to create some complete graphs using ggplot.
Activities
Add links to whichever activity or activities are relevant to this meeting.
Using any of the data sets you have encountered on the course so far, produce two different plots to visualise aspects of your chosen dataset(s). Submit your two plots by saving them as PNG files from within RStudio and export them to your computer, and then you can upload the files to the discussion for this task.
Make sure you have read Chapter 1 Data Visualization in the r4ds book. If you have time it would be good to refresh before the next class the introduction to ggplot that we did in class.
There are three supporting videos, shown below, which provide additional technical information on ggplot. We’ll cover some of these points in the class today and also in upcoming classes as we start to work on our statistical thinking skills. You do not need to watch all three videos before the next class. It will be advantageous if you have watched all three videos before we start the portfolio projects later in the semester.
Video on groups, facets, and stats
- Video on scales and guides
- Video on themes and multiple plots
Slides
Slide decks for the videos