Visualizations and the grammar of graphics

Jun 14, 2022 10:00 AM


  • Identify the importance of graphics in communicating information
  • Define the layered grammar of graphics
  • Demonstrate how to use layered grammar of graphics to build Minard’s graph of Napoleon’s invasion of Russia
  • Practice generating layered graphics using ggplot2

Before class

  • Read chapters 1-4 from R for Data Science
    • Chapters 1, 2, and 4 are very short but set the stage for the next few weeks
    • Chapter 3 is crucial - you need to read this chapter and complete some of the exercises before coming to class. Exercise solutions can be found here.
  • Read The grammar of graphics
  • Install and setup software
    • Definitely have R and RStudio installed and operational for class today
    • If you haven’t gotten GitHub setup yet, that’s fine but you will need it to complete homework 1

Class materials

Additional resources

Graphical design


Useful cheatsheets

What you need to do after class

  • Register your GitHub username for the course - all homework assignments will be in private repositories. Private repos can only be seen and edited by members of our course organization. Once you register your GitHub account, I will invite you to join the course organization. If you don’t register your account, you won’t have access to any of the homework assignments.
  • Complete the first homework assignment
  • Install the rcfss library from GitHub. To install the package, run the command devtools::install_github("uc-cfss/rcfss") in the console. We will be using data from this package in class next week.
If you do not already have the devtools library installed, you will get an error. Go back and install this first using install.packages("devtools"), then run devtools::install_github("uc-cfss/rcfss") in the console.
Benjamin Soltoff
Benjamin Soltoff
Assistant Senior Instructional Professor in Computational Social Science & the College