::install_github("mattblackwell/gov50data") remotes
Summarizing Relationships, Tidying and Joining Data
This content is from Fall 2022. Go to Fall 2023 site
Readings
- 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.
Data
- 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:
library(tidyverse)
<- read_csv("covid_votes.csv") covid_votes
- For Thursday lecture, we added to additional data sets to
gov50data
. If you cannot install that package, then you can download them:mortality.csv
andspotify.csv
. Put them in the same folder as your Rmd file and use these commands to load:
library(tidyverse)
<- read_csv("mortality.csv")
mortality <- read_csv("spotify.csv") spotify
- We will also use data from the
nycflights13
package that you can install with:
install.packages("nycflights13")
Slides and Code
- Tuesday (10/4) lecture: Summarizing relationships and writing our own functions
- PDF of slides as I present them
- PDF of handout version of slides (no incremental slides)
- Code:
covid_votes.Rmd
- Thursday (10/6) lecture: Causality review, pivoting longer, joining data.
- PDF of slides as I present them
- PDF of handout version of slides (no incremental slides)
- Code:
lecture-11.Rmd