get_svi()
calculates and constructs an SVI table for a
geographic level of interest based on CDC/ATSDR SVI
documentation (https://www.atsdr.cdc.gov/placeandhealth/svi/data_documentation_download.html).
Briefly, by taking into account 4 themes of census variables that represent
challenges in socioeconomic status, household characteristics, racial and
ethnic minority status and housing/transportation, SVI uses percentile
ranking within a region to indicate the relative social vulnerability of
the geographic units (communities) in that region.
get_svi(year, data)
A tibble of SVI with rows representing geographic units, 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.
The year of interest (available 2012-2021), must match the year specified in retrieving census data.
The census data retrieved by get_census_data()
.
if (FALSE) { # Sys.getenv("CENSUS_API_KEY") != ""
# Census API key required
pa2018 <- get_census_data(
year = 2018,
geography = "county",
state = "PA")
get_svi(2018, pa2018)
}
Run the code above in your browser using DataLab