Skip to contents

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:

  • id character ISO 3166-1 alpha-3 country code

  • iso2code character ISO 3166-1 alpha-2 country code

  • state_region character Department of State Region

  • who_region character World Health Organization (WHO) Region acronym

  • who_region_desc character WHO Region

  • who_country character WHO english country name

  • incomelevel character Income Level

  • population numeric Total population

  • eighteenplus numeric Population age 18 years or older

  • geometry sfc_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) {
  # 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)
}