census_block_group_populations: Retrieve Urban and Rural (p2) Summary File 1 (sf1) Census...

View source: R/census.R

census_block_group_populationsR Documentation

Retrieve Urban and Rural (p2) Summary File 1 (sf1) Census data

Description

Retrieve Urban and Rural (p2) Summary File 1 (sf1) Census data

Usage

census_block_group_populations(
  state_fips_code,
  vintage = c("2010", "2000"),
  key = Sys.getenv("CENSUS_KEY")
)

Arguments

state_fips_code

Two-digit state code (e.g., "01" == "Alabama").

vintage

= Year of dataset, e.g., 2000. This data is only collected during decennial censuses.

key

Your Census API key, requested using https://api.census.gov/data/key_signup.html.

Details

Decennial Census API Documentation https://www.census.gov/data/developers/data-sets/decennial-census.html

URBAN AND RURAL variables listed in: https://api.census.gov/data/2010/dec/sf1/variables.html

Name Label Concept Required Attributes Limit Predicate Type Group
P002001 Total URBAN AND RURAL not required P002001ERR 0 int P2
P002002 Total!!Urban URBAN AND RURAL not required 0 int P2
P002003 Total!!Urban!!Inside urbanized areas URBAN AND RURAL not required 0 int P2
P002004 Total!!Urban!!Inside urban clusters URBAN AND RURAL not required 0 int P2
P002005 Total!!Rural URBAN AND RURAL not required 0 int P2

Value

A tibble with FIPS codes and P2 variables by tract group for the desired state.

Examples

## Not run: 
## data for all block groups in Missouri
census_block_group_populations("29")

## data for all block groups
fips_codes_for_states_and_dc %>%
  mutate(data = purrr::map(
    state_fips_code,
    census_block_group_populations
  )) %>%
  tidyr::unnest(cols = c(data))

## End(Not run)


RoeLabWustl/roelabr documentation built on Aug. 27, 2022, 9:57 a.m.