Skip to contents

load_billion_data() provides access to the raw inputs to the Billions stored within the World Health Data Hub or the World Health Organization's xMart4 database. By default, it filters the loaded data to take the most recently uploaded data for each indicator, country, and year. The user can also specify to take the latest data before a certain time period, or to extract all data from the database.

Usage

load_billion_data(
  data_type = c("wrangled_data", "projected_data", "final_data"),
  billion = c("all", "hep", "hpop", "uhc"),
  ind_codes = "all",
  version = "latest",
  na_rm = TRUE,
  experiment = NULL,
  silent = TRUE,
  data_source = c("whdh", "xmart"),
  ...
)

Arguments

data_type

(string) The type of data to load.

  • wrangled_data (default): raw data that has been wrangled into a suitable form for analysis.

  • projected_data: data that has been fully projected to the target year but has not yet been transformed or calculated upon.

  • final_data: the complete set of billions data with transformed values, contributions, and all calculations available.

billion

(string) One of "all" (default), "hep", "hpop", or "uhc". If "all", downloads all indicators for all three billions.

ind_codes

(character vector) The name of the indicator (or indicators) to load data for. If all, downloads data for all indicators for a given billion. Ignored if billion = "all".

version

(string) Either latest or a yyyy-MM-dd or yyyy-mm-ddTHH-MM-SS formatted string.

  • If latest, the latest version of the data will be downloaded.

  • If a yyyy-MM-dd formatted string, the latest version of the data on or before the provided date will be downloaded.

  • If a yyyy-mm-ddTHH-MM-SS formatted string, an exact match for the given time stamp is sought, if it exists; otherwise, raises an error.

na_rm

(logical) Specifies whether to filter the data to only rows where value is not missing. Defaults to TRUE.

experiment

(string) Either NULL or a string ("unofficial" by default). Identifies where the Bronze/Silver/Gold data layers from which data is downloaded are located. Cannot be an empty string.

  • If NULL, the root folder for the data layers is the 3B folder (i.e., where the "official" data is stored). For example, 3B/Silver/....

  • If a string, the root folder for the data layers is a sub-folder within the Sandbox layer of the 3B data lake (e.g., if experiment = "my_exp", then data is download from 3B/Sandbox/my_exp/{data_layer}/...)

silent

(logical) Specifies whether to show authentication messages and a download progress bar. Defaults to TRUE.

data_source

(string) Ether "whdh" or "xmart". Indicates where to download the data from

...

Additional arguments passed to xmart4::xmart4_table(). Use if you need to provide additional token specifications for Azure authentication.

Value

A data frame.

Details

This function requires that the user have the xmart4 and whdh packages installed and setup to access the data. For quetions about getting the relevant permissions, please contact kanjim@who.int or messeillere@who.int.