find_svi_x | R Documentation |
find_svi_x()
is like a wrapper for
get_census_data()
and get_svi_x()
that retrieves
census data and produces SVI for a customized geographic level consisted of
a Census geography. The census data is retrieved at the Census geographic
level, and estimate counts are summed across the customized geographic
level to calculate SVI. Note that a Census API key is required for this
function to work, which can be obtained at
https://api.census.gov/data/key_signup.html and set up using
tidycensus::census_api_key()
.
find_svi_x(
year,
geography,
state = NULL,
county = NULL,
key = NULL,
geometry = FALSE,
xwalk
)
year |
A year of interest (available 2012-2022). |
geography |
The Census geography level of interest (e.g."county", "zcta", "tract"). |
state |
(Optional) Specify the state of interest. Default |
county |
(Optional) Specify the county of interest, must be combined with a value supplied to "state". |
key |
Your Census API key. Obtain one at
https://api.census.gov/data/key_signup.html. To set up, use
|
geometry |
Default as |
xwalk |
A crosswalk (relationship table) between the Census geographic
level and the customized geographic level of interest. A crosswalk between
US counties and commuting zones
|
A tibble of SVI with rows representing the customized geographic
units (with a column name of GEOID
), and columns indicating variable
names (first two columns containing geographic information). For detailed
description of the variable names (column names), please refer to
CDC/ATSDR
documentation (https://www.atsdr.cdc.gov/placeandhealth/svi/data_documentation_download.html).
find_svi()
for retrieving census data and calculating SVI for
multiple year-state pairs at a Census geographic level. get_census_data()
(with exp = TRUE
) and get_svi_x()
for separate functions for data
retrieval and SVI calculation at a customized geographic level.
# Census API key required
find_svi_x(
year = 2020,
geography = "county",
xwalk = cty_cz_2020_xwalk
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.