ff_iterate_acs: Iteratively import ACS data

View source: R/import_census.R

ff_iterate_acsR Documentation

Iteratively import ACS data

Description

This function makes repeated calls to the Census API through the tidycensus package. It allows users to import multiple years and geographic areas with one function call.

Usage

ff_iterate_acs(parameters_list)

Arguments

parameters_list

A named list of parameters to feed into the get_acs function from tidycensus. The name of each item should correspond to the parameter name in get_acs.

Value

A tidy dataframe with all census data. Additional columns for the yar and geographic region are added.

Examples

parameters <- list(geography = c('us', 'state', 'county', 'tract'),
                   state = c(NA, rep('NC', 3)),
                   county = c(rep(NA, 3), 'Forsyth'),
                   table = c(rep('S2301', 3), NA),
                   variables = c(rep(NA, 3), 'S2301_C03_001'),
                   survey = c(rep('acs1', 3), 'acs5'),
                   year = rep(current_year, 4),
                   use_table = c(rep(T, 3), F))

employment <- ff_iterate_acs(parameters)


forsythfuture/FFtools documentation built on April 5, 2022, 10:02 p.m.