Session Ready
Exercise

Joining data from an external data frame

When working with geographic data in R, you'll commonly want to join attribute information from an external dataset to it for mapping and spatial analysis. The sf package enables the use of the tidyverse *_join() functions for simple features objects for this purpose. In this exercise, you'll learn how to join data to a spatial dataset of legislative boundaries for the Texas House of Representatives that you've obtained using tigris.

Instructions
100 XP
  • Get a dataset of legislative district boundaries for Texas using the state_legislative_districts() function.
  • Set the house parameter to "lower" to request data for the Texas House of Representatives.
  • Use the left_join() function to merge a dataset of Texas House representatives to their legislative district boundaries.