knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of whoville is to provide a package country reference data published by the World Health Organization, United Nations and World Bank easily accessible in R. At the moment, this is a reference dataset and set of functions to work with country codes and names, allowing easy conversion between names and codes as well as easy access to region codes, WHO member status, and other published country metadata. This is used to assist the work of the WHO's Division of Data, Analytics, and Delivery for Impact's Global Programme of Work 13.
Some functions are built to help you turn names or country codes into ISO3 codes:
names_to_code()
is the workhorse function that helps match country names and returns standardized country codes.names_to_iso3()
is a wrapper around names_to_code()
that automatically outputs ISO3 code.codes_to_iso3()
converts other country codes into ISO3 format.valid_codes()
lets you quickly check which country codes in a vector are recognized by the whoville package.Other functions encourage a tidy R workflow where ISO3 codes are used as the unique identifier for each country:
iso3_to_regions()
takes in a vector of ISO3 codes and returns specified region values.iso3_to_codes()
takes in a vector of ISO3 codes and returns specified country codes.iso3_to_names()
takes in a vector of ISO3 codes and returns specified country names.is_who_member()
takes in a vector of ISO3 codes and checks if they are a WHO member state or not.is_oecd_member()
takes in a vector of ISO3 codes and checks if they are an OECD member state or not.is_gbd_high_income()
takes in a vector of ISO3 codes and checks if they are classified as high-income in the 2019 GBD from IHME.All of these functions are built on top of the countries
data frame also exported
with the package and developed off of public datasets provided by the World Health
Organization and United Nations. Details available through ?countries
.
You can install whoville from Github with:
devtools::install_github("gpw13/whoville")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.