ff_iterate_acs: Iteratively import ACS data

Description Usage Arguments Value Examples

View source: R/import_census.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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 Dec. 5, 2019, 3:16 a.m.