Summarizing Relationships, Tidying and Joining Data


October 4, 2022

This content is from Fall 2022. Go to Fall 2023 site


  • For summarizing relationships, see QSS 3.6 and MD 5.1.1.
  • For pivoting and tidy data, see MD Ch 4.
  • For more on joins, see the chapter 20 in R for Data Science.


  • Reinstall the Gov 50 data package that has new data for this week:
  • If you cannot install the package, you can download the data locally at covid_votes.csv to the same directory as your Rmd file and load it using:
covid_votes <- read_csv("covid_votes.csv")
  • For Thursday lecture, we added to additional data sets to gov50data. If you cannot install that package, then you can download them: mortality.csv and spotify.csv. Put them in the same folder as your Rmd file and use these commands to load:
mortality <- read_csv("mortality.csv")
spotify <- read_csv("spotify.csv")
  • We will also use data from the nycflights13 package that you can install with:

Slides and Code