One table to rule them all and in keys bind them! Output is available through the package as "onetable," but this function can be used to recreate this dataset.
Note: Department of State (DoS) regions are handled externally in a CSV file.
Usage
get_onetable(
usaid_metadata_file = NULL,
vintage = 2022,
country_geometries = country_coords
)Arguments
- usaid_metadata_file
(character, optional) A file path to the file containing DoS regions. Expects at least two columns, "iso_alpha3", "state_region"
- vintage
(numeric, default: 2022) The year of population projections to use from UN data
- country_geometries
(data.frame, default: country_coords) a data.frame/sfc with at least two columns: "iso3code", "geometry"
Value
Returns a df of 238 rows and 10 columns, including:
idcharacter ISO 3166-1 alpha-3 country codeiso2codecharacter ISO 3166-1 alpha-2 country codestate_regioncharacter Department of State Regionwho_regioncharacter World Health Organization (WHO) Region acronymwho_region_desccharacter WHO Regionwho_countrycharacter WHO english country nameincomelevelcharacter Income Levelpopulationnumeric Total populationeighteenplusnumeric Population age 18 years or oldergeometrysfc_GEOMETRY Geometry
Details
Note: Population updates for Pitcairn Islands and Kosovo are hardcoded and must be pulled manually via CIA factbook unless another source is found.
See also
onetable for more complete data documentation
Examples
if (FALSE) { # \dontrun{
# UPDATING ONETABLE
# This is the typical location of the USAID DoS file:
usaid_file <- file.path(Sys.getenv("USERPROFILE"), "CDC", "ITF-COVID19-SAVI - Documents", "usaid_dos_regions.csv")
onetable <- get_onetable(usaid_file)
usethis::use_data(onetable, overwrite = TRUE)
} # }