
Our session for this week will explore ggplot2, one of the most popular and powerful packages for creating data displays in R. We will start by covering the “grammar of graphics” logic of creating plots by stacking multiple layers. Then, we will walk through several examples of using this logic to create scatter plots, bar graphs, population pyramids, panel plots, and others.
- Uploading/ Reading data into R (as csv of Stata file)
- Exploring the potential of ggplot2 to create scatter plots, bar graphs, population pyramids, panel plots
At the end of the session participants will leave with code to prepare visuals on R and have created one of the following: scatter plots, bar graphs, population pyramids, panel plots.
Optional Readings (only view the graphs in the papers):
Danielle Rhubart, Alexis Santos; Research Note Showing That the Rural Mortality Penalty Varies by Region, Race, and Ethnicity in the United States, 1999–2016. Demography 1 December 2023; 60 (6): 1699–1709.
Daniel Ramirez, Elena Povedano, Aitor García, Michael Lund; Smoke's Enduring Legacy: Bridging Early-Life Smoking Exposures and Later-Life Epigenetic Age Acceleration. Demography 1 February 2025; 62 (1): 113–135.
Dennis M. Feehan, Mary Mahy, Matthew J. Salganik; The Network Survival Method for Estimating Adult Mortality: Evidence From a Survey Experiment in Rwanda. Demography 1 August 2017; 54 (4): 1503–1528.