A. Read the Article

“Voter Registrations Are Way, Way Down During the Pandemic” (Jun 26, 2020) by Kaleigh Rogers and Nathaniel Rakich

https://fivethirtyeight.com/features/voter-registrations-are-way-way-down-during-the-pandemic/

B. Discuss in Small Groups

  1. How are graphics used to tell the author’s story?

  2. What geometries are used?

C. The Data

What does the raw data look like?

library(tidyverse)

# Import data
vreg<-read.csv("https://raw.githubusercontent.com/fivethirtyeight/data/master/voter-registration/new-voter-registrations.csv",
               header=TRUE)


head(vreg)
##   Jurisdiction Year Month New.registered.voters
## 1      Arizona 2016   Jan                 25852
## 2      Arizona 2016   Feb                 51155
## 3      Arizona 2016   Mar                 48614
## 4      Arizona 2016   Apr                 30668
## 5      Arizona 2020   Jan                 33229
## 6      Arizona 2020   Feb                 50853

D. Processing the Data

Relevel

Relevel the data so that its in the right order:

# Level the Month variable so that its in the right order (ie not alphabetical)
vreg$Month<-factor(vreg$Month,
                   levels=c("Jan", "Feb", "Mar", "Apr", "May"))

Tidy

### USE spread() FROM tidyr
vregYear<-vreg%>%
  spread(Year, New.registered.voters)

### RENAME THE COLUMNS
colnames(vregYear)<-c("Jurisdiction", "Month", "Y2016", "Y2020")

Mutate

Add change in registration.

### mutate() FROM dplyr()
vregChange<-vregYear%>%
  mutate(change=Y2020-Y2016)%>%
  mutate(positive=change>0)

E. Recreate the graphic

Other hints

  • You can add another column to define color
  • Pay careful attention to the axes, you might want to read the help file for facet_wrap
ggplot(data=vregChange, aes(x=Month, y=change, fill=positive))+
  geom_col()+
  facet_wrap(.~Jurisdiction, scales="free_y")