View source: R/dep_calc_index.R
dep_calc_index | R Documentation |
Calculates various measures of deprivation on data you have.
Data cannot be automatically downloaded with this option, and the
output options are more limited. See Details under dep_get_index
for
more information. For information about structuring your data prior to
using this function, see Details below.
dep_calc_index(.data, geography, index, year, survey = "acs5",
return_percentiles = FALSE, keep_subscales = FALSE, keep_components = FALSE,
output = "wide")
.data |
A data frame, tibble, or |
geography |
A character scalar; one of |
index |
A character scalar or vector listing deprivation measures
to return. These include the area deprivation index ( |
year |
A numeric scalar between 2010 and 2022. |
survey |
A character scalar representing the Census product. It can
be any American Community Survey product (either |
return_percentiles |
A logical scalar; if |
keep_subscales |
A logical scalar; if |
keep_components |
A logical scalar; if |
output |
A character scalar; if |
Input data must be "wide" formatted and should have the following columns:
"GEOID"
The appropriately formatted GEOID values for the geography given in the function. This is required.
"YEAR"
The year that corresponds to the demographic data. For five-year ACS data, this should correspond to the final year in the period (e.x. 2021 for the 2017-2021 ACS). This is required only if deprivation scores are being generated for more than one year.
All of the necessary columns required for the deprivation scores and years given (since the input measures vary between scores and over time for individual scores.)
A tibble object containing the requested deprivation measures.
## load sample data
ndi_m <- dep_sample_data(index = "ndi_m")
## calculate NDI with sample data
ndi_m <- dep_calc_index(ndi_m, geography = "county", index = "ndi_m", year = 2022,
return_percentiles = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.