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 code
- iso2codecharacter ISO 3166-1 alpha-2 country code
- state_regioncharacter Department of State Region
- who_regioncharacter World Health Organization (WHO) Region acronym
- who_region_desccharacter WHO Region
- who_countrycharacter WHO english country name
- incomelevelcharacter Income Level
- populationnumeric Total population
- eighteenplusnumeric Population age 18 years or older
- geometrysfc_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)
} # }