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 = NULL, download_data = TRUE, save = TRUE,
  burden_save_name = NULL, add_mdr_data = TRUE,
  additional_datasets = NULL, mdr_save_name = NULL, mdr_url = NULL,
  return = TRUE, verbose = TRUE, use_utils = FALSE,
  retry_download = TRUE)

Arguments

url

Character string, indicating the url of the TB burden data. Default is current url. This argument is depreciated and will be removed from future releases. The TB burden URL is now supplied internally - see available_datasets for details.

download_data

Logical, defaults to TRUE. If not found locally should the data be downloaded from the specified URL?

save

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.

burden_save_name

Character string, name to save the data under. This argument is depreciated and will be removed from future releases. Dataset naming is now handled internally.

add_mdr_data

Logical, defaults to TRUE. Should MDR TB burden data be downloaded and joined to the TB burden data.

additional_datasets

A character vector specifying the names of the additional datasets to import. See available_datasets for available datasets. Use "all" to download all available datasets.

mdr_save_name

Character string, name to save the MDR data under. This argument is depreciated and will be removed from future releases. Dataset naming is now handled internally.

mdr_url

Character string, indicating the url of the MDR TB data. This argument is depreciated and will be removed from future releases. The MDR-TB burden URL is now supplied internally - see available_datasets for details.

return

Logical, should the data be returned as a dataframe. Defaults to TRUE.

verbose

Logical, defaults to TRUE. Should additional status and progress messages be displayed.

use_utils

Logical, defaults to FALSE. Used for testing alternative data download function. When TRUE data is downloaded using read.csv.

retry_download

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.

Value

The WHO TB burden data as a tibble.

See also

get_data search_data_dict

Examples

## Default datasets tb_burden <- get_tb_burden(additional_datasets = available_datasets$dataset[3])
#> Downloading data from: https://extranet.who.int/tme/generateCSV.asp?ds=estimates
#> Saving data to: /tmp/RtmpIruhtW/tb_burden.rds
#> Downloading data from: https://extranet.who.int/tme/generateCSV.asp?ds=mdr_rr_estimates
#> Saving data to: /tmp/RtmpIruhtW/mdr_tb.rds
#> Joining TB burden data and MDR TB data.
#> Getting additional dataset: Latent TB infection
#> Downloading data from: https://extranet.who.int/tme/generateCSV.asp?ds=ltbi_estimates
#> Saving data to: /tmp/RtmpIruhtW/latent_tb_infection.rds
#> Joining TB burden data and additional datasets.
head(tb_burden)
#> # A tibble: 6 x 80 #> country iso2 iso3 iso_numeric g_whoregion year e_pop_num e_inc_100k #> <chr> <chr> <chr> <int> <chr> <int> <int> <dbl> #> 1 Afghan… AF AFG 4 Eastern Me… 2000 20093756 190 #> 2 Afghan… AF AFG 4 Eastern Me… 2001 20966463 189 #> 3 Afghan… AF AFG 4 Eastern Me… 2002 21979923 189 #> 4 Afghan… AF AFG 4 Eastern Me… 2003 23064851 189 #> 5 Afghan… AF AFG 4 Eastern Me… 2004 24118979 189 #> 6 Afghan… AF AFG 4 Eastern Me… 2005 25070798 189 #> # … with 72 more variables: e_inc_100k_lo <dbl>, e_inc_100k_hi <dbl>, #> # e_inc_num <int>, e_inc_num_lo <int>, e_inc_num_hi <int>, #> # e_tbhiv_prct <dbl>, e_tbhiv_prct_lo <dbl>, e_tbhiv_prct_hi <dbl>, #> # e_inc_tbhiv_100k <dbl>, e_inc_tbhiv_100k_lo <dbl>, #> # e_inc_tbhiv_100k_hi <dbl>, e_inc_tbhiv_num <int>, e_inc_tbhiv_num_lo <int>, #> # e_inc_tbhiv_num_hi <int>, e_mort_exc_tbhiv_100k <dbl>, #> # e_mort_exc_tbhiv_100k_lo <dbl>, e_mort_exc_tbhiv_100k_hi <dbl>, #> # e_mort_exc_tbhiv_num <int>, e_mort_exc_tbhiv_num_lo <int>, #> # e_mort_exc_tbhiv_num_hi <int>, e_mort_tbhiv_100k <dbl>, #> # e_mort_tbhiv_100k_lo <dbl>, e_mort_tbhiv_100k_hi <dbl>, #> # e_mort_tbhiv_num <int>, e_mort_tbhiv_num_lo <int>, #> # e_mort_tbhiv_num_hi <int>, e_mort_100k <dbl>, e_mort_100k_lo <dbl>, #> # e_mort_100k_hi <dbl>, e_mort_num <int>, e_mort_num_lo <int>, #> # e_mort_num_hi <int>, cfr <dbl>, cfr_lo <dbl>, cfr_hi <dbl>, #> # c_newinc_100k <dbl>, c_cdr <dbl>, c_cdr_lo <dbl>, c_cdr_hi <dbl>, #> # source_rr_new <chr>, source_drs_coverage_new <chr>, #> # source_drs_year_new <int>, e_rr_pct_new <dbl>, e_rr_pct_new_lo <dbl>, #> # e_rr_pct_new_hi <dbl>, e_mdr_pct_rr_new <int>, source_rr_ret <chr>, #> # source_drs_coverage_ret <chr>, source_drs_year_ret <int>, #> # e_rr_pct_ret <dbl>, e_rr_pct_ret_lo <dbl>, e_rr_pct_ret_hi <dbl>, #> # e_mdr_pct_rr_ret <int>, e_inc_rr_num <int>, e_inc_rr_num_lo <int>, #> # e_inc_rr_num_hi <int>, e_mdr_pct_rr <int>, e_rr_in_notified_pulm <int>, #> # e_rr_in_notified_pulm_lo <int>, e_rr_in_notified_pulm_hi <int>, #> # source_hh <chr>, e_hh_size <dbl>, prevtx_data_available <int>, #> # newinc_con04_prevtx <int>, ptsurvey_newinc <lgl>, #> # ptsurvey_newinc_con04_prevtx <lgl>, e_prevtx_eligible <dbl>, #> # e_prevtx_eligible_lo <dbl>, e_prevtx_eligible_hi <dbl>, #> # e_prevtx_kids_pct <dbl>, e_prevtx_kids_pct_lo <dbl>, #> # e_prevtx_kids_pct_hi <dbl>
## Add in the latent TB dataset as an additional dataset (see getTBinR::avaiable_datasets) tb_with_latents <- get_tb_burden(additional_datasets = available_datasets$dataset[3])
#> Loading data from: /tmp/RtmpIruhtW/tb_burden.rds
#> Loading data from: /tmp/RtmpIruhtW/mdr_tb.rds
#> Joining TB burden data and MDR TB data.
#> Getting additional dataset: Latent TB infection
#> Loading data from: /tmp/RtmpIruhtW/latent_tb_infection.rds
#> Joining TB burden data and additional datasets.
head(tb_with_latents)
#> # A tibble: 6 x 80 #> country iso2 iso3 iso_numeric g_whoregion year e_pop_num e_inc_100k #> <chr> <chr> <chr> <int> <chr> <int> <int> <dbl> #> 1 Afghan… AF AFG 4 Eastern Me… 2000 20093756 190 #> 2 Afghan… AF AFG 4 Eastern Me… 2001 20966463 189 #> 3 Afghan… AF AFG 4 Eastern Me… 2002 21979923 189 #> 4 Afghan… AF AFG 4 Eastern Me… 2003 23064851 189 #> 5 Afghan… AF AFG 4 Eastern Me… 2004 24118979 189 #> 6 Afghan… AF AFG 4 Eastern Me… 2005 25070798 189 #> # … with 72 more variables: e_inc_100k_lo <dbl>, e_inc_100k_hi <dbl>, #> # e_inc_num <int>, e_inc_num_lo <int>, e_inc_num_hi <int>, #> # e_tbhiv_prct <dbl>, e_tbhiv_prct_lo <dbl>, e_tbhiv_prct_hi <dbl>, #> # e_inc_tbhiv_100k <dbl>, e_inc_tbhiv_100k_lo <dbl>, #> # e_inc_tbhiv_100k_hi <dbl>, e_inc_tbhiv_num <int>, e_inc_tbhiv_num_lo <int>, #> # e_inc_tbhiv_num_hi <int>, e_mort_exc_tbhiv_100k <dbl>, #> # e_mort_exc_tbhiv_100k_lo <dbl>, e_mort_exc_tbhiv_100k_hi <dbl>, #> # e_mort_exc_tbhiv_num <int>, e_mort_exc_tbhiv_num_lo <int>, #> # e_mort_exc_tbhiv_num_hi <int>, e_mort_tbhiv_100k <dbl>, #> # e_mort_tbhiv_100k_lo <dbl>, e_mort_tbhiv_100k_hi <dbl>, #> # e_mort_tbhiv_num <int>, e_mort_tbhiv_num_lo <int>, #> # e_mort_tbhiv_num_hi <int>, e_mort_100k <dbl>, e_mort_100k_lo <dbl>, #> # e_mort_100k_hi <dbl>, e_mort_num <int>, e_mort_num_lo <int>, #> # e_mort_num_hi <int>, cfr <dbl>, cfr_lo <dbl>, cfr_hi <dbl>, #> # c_newinc_100k <dbl>, c_cdr <dbl>, c_cdr_lo <dbl>, c_cdr_hi <dbl>, #> # source_rr_new <chr>, source_drs_coverage_new <chr>, #> # source_drs_year_new <int>, e_rr_pct_new <dbl>, e_rr_pct_new_lo <dbl>, #> # e_rr_pct_new_hi <dbl>, e_mdr_pct_rr_new <int>, source_rr_ret <chr>, #> # source_drs_coverage_ret <chr>, source_drs_year_ret <int>, #> # e_rr_pct_ret <dbl>, e_rr_pct_ret_lo <dbl>, e_rr_pct_ret_hi <dbl>, #> # e_mdr_pct_rr_ret <int>, e_inc_rr_num <int>, e_inc_rr_num_lo <int>, #> # e_inc_rr_num_hi <int>, e_mdr_pct_rr <int>, e_rr_in_notified_pulm <int>, #> # e_rr_in_notified_pulm_lo <int>, e_rr_in_notified_pulm_hi <int>, #> # source_hh <chr>, e_hh_size <dbl>, prevtx_data_available <int>, #> # newinc_con04_prevtx <int>, ptsurvey_newinc <lgl>, #> # ptsurvey_newinc_con04_prevtx <lgl>, e_prevtx_eligible <dbl>, #> # e_prevtx_eligible_lo <dbl>, e_prevtx_eligible_hi <dbl>, #> # e_prevtx_kids_pct <dbl>, e_prevtx_kids_pct_lo <dbl>, #> # e_prevtx_kids_pct_hi <dbl>