query_acs: Obtain 5-Year American Community Survey Estimates

Description Usage Arguments Value

View source: R/acs_screening.R

Description

The U.S. Census Bureau has published 5-year esimates of demographic data since 2009. The data is aggregated at the national, state, county, census tract, and census block group levels.

This function queries the Census Bureau API based on FIPS codes for various geographies. Substituting a wildcard character "*" instead of a FIPS code returns all values within the parent geography (i.e. tract = "*" will return data for all tracts within a county).

The API limits the number of queries for users who lack an API key. A key can be obtained here.

Usage

1
2
3
4
5
6
7
8
9
query_acs(
  var = c("B19013_001E", "B25077_001E"),
  year = NULL,
  state,
  county = NULL,
  tract = NULL,
  blkgrp = NULL,
  key = NULL
)

Arguments

var

Variables to query from the ACS. For a list of the available variables and codes (for the 2017 ACS), see the Official Documentation. Defaults to Median Household Income (B19013_00E) and Median Home Value (Owner-Occupied Units) (B25077_001E). Supports groups.

year

Four-digit year. Defaults to the most recent data, for 2017.

state

Two-digit state FIPS code. Alternatively, "us" for national-level statistics. Supports wildcard string ("*").

county

Three-digit county FIPS code. Supports wildcard string ("*").

tract

Five-digit census tract FIPS code. Supports wildcard string ("*").

blkgrp

One-digit blog group FIPS code.

key

(optional) Developer key.

Value

Tibble of data points and FIPS codes, one line per valid input geography.


crazybilly/fundRaising documentation built on July 30, 2021, 12:51 a.m.