PS02: Data Visualisation

Published

April 27, 2026

Overview

Practice creating plots with ggplot2 — scatterplots, histograms, and boxplots — using data on births from the state of North Carolina.

Read Chapter 2 of ModernDive before attempting this problem set.


Download

Download the problem set template, open it in RStudio, and complete the exercises directly in the document.

PS02.zip


Setup

Run this at the top of your document to install and load the required packages:

if (!require(pacman)) install.packages("pacman")
pacman::p_load(ggplot2, dplyr, readr)

Exercises

Scatterplots

Investigate relationships between numerical variables.

Histograms

Explore the distribution of a single numerical variable.

Boxplots

Compare distributions of a numerical variable across groups.

Independent practice

Choose appropriate plot types to answer open-ended questions.


When you are done, render to HTML and submit on Moodle. Name your file PS02_yourname.html.