Announcements

Exercises

Today’s data set comes from the US Elections Project. We will focus specifically on early voting data for North Carolina through November 1, 2020.

The variables are

We first read in the file nc_votes_nov1.shp with the st_read function, saving as nc_votes.

nc_votes <- st_read("data/nc_votes_nov1.shp", quiet = TRUE)

Exercise 1

Examine the data frame nc_votes_nov1. How does it differ from the data frames we have seen before? What type of geometry is associated with each simple feature?

Exercise 2

Let’s use nc_votes to create a map of North Carolina.

ggplot(nc_votes) +
  geom_sf()

Starting with the code above, update the visualization so that the counties have a fill color corresponding to the percentage of requested mail-in ballots that have been returned and accepted. Include informative labels, colors and any other aesthetics.

Exercise 3

Create a map of North Carolina where the counties have a fill color corresponding to the percentage of votes that were cast by mail. Include informative labels, colors and any other aesthetics.

Exercise 4

Create an effective spatial data visualization using these data exploring a topic of your choosing.


Read more about factors to consider when creating election maps: https://www.nytimes.com/interactive/2020/10/30/opinion/election-results-maps.html