Get the TB burden data, and multi-drug resistant TB (MDR-TB) data from the WHO, see
here for details. This function will first attempt
to load the data from the temporary directory (tempdir). If that fails, and download_data = TRUE, it
will instead download the data. The MDR TB data is only available for the latest year of data.
get_tb_burden(url = "https://extranet.who.int/tme/generateCSV.asp?ds=estimates",
download_data = TRUE, save = TRUE, burden_save_name = "TB_burden",
add_mdr_data = TRUE, mdr_save_name = "MDR_TB",
mdr_url = "https://extranet.who.int/tme/generateCSV.asp?ds=mdr_rr_estimates",
return = TRUE, verbose = TRUE, use_utils = FALSE,
retry_download = TRUE)Character string, indicating the url of the TB burden data. Default is current url.
Logical, defaults to TRUE. If not found locally should the data be
downloaded from the specified URL?
Logical, should the data be saved for reuse during the current R session. Defaults to
TRUE. If TRUE then the data is saved to the temporary directory specified by tempdir.
Character string, name to save the data under. Defaults to "TB_burden".
Logical, defaults to TRUE. Should MDR TB burden data be downloaded and joined
to the TB burden data.
Character string, name to save the MDR data under. Defaults to "MDR_TB"
Character string, indicating the url of the MDR TB data.
Logical, should the data be returned as a dataframe.
Defaults to TRUE.
Logical, defaults to TRUE. Should additional status and progress messages
be displayed.
Logical, defaults to FALSE. Used for testing alternative
data download function. When TRUE data is downloaded using read.csv.
Logical defaults to TRUE. When TRUE, if downloading
fails, the function will try repeatedly to download the data within 3 seconds, up
to 3 times.
The WHO TB burden data as a tibble.
get_data search_data_dict
# NOT RUN {
tb_burden <- get_tb_burden()
head(tb_burden)
# }
Run the code above in your browser using DataLab