Exercise

Comparing ACS estimates for multiple years

The American Community Survey is updated every year, which allows researchers to use ACS datasets to study demographic changes over time.

In this exercise, you'll learn how to use the tidyverse function map_df() to work with multi-year ACS data. map_df() helps analysts iterate through a sequence of values, compute a process for each of those values, then combine the results into a single data frame. You'll be using map_df() in this way with ACS data, as you iterate through a vector of years, retrieve ACS data for each year, and combine the results. This will allow you to view how ACS estimates have changed over time.

Instructions

100 XP
  • Use the tidyverse map_df() function to specify that you'll be iterating through the vector of years 2012:2016.
  • Specify the survey as "acs1" to get data from the 1-year ACS.
  • Use the mutate() function to calculate a new column which will store the survey year in your output data frame.