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 = FALSE,
  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 (experimental datasets such as incidence by age and sex are excluded from this list).

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 FALSE. 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])
#> Incidence by age and sex data is experimental and may cause issues for other #> datasets. Use with caution! #> Open an issue here if you run into problems: https://github.com/seabbs/getTBinR/issues
head(tb_burden)
#> # A tibble: 6 x 79 #> 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 20779953 190 #> 2 Afghan… AF AFG 4 Eastern Me… 2001 21606988 189 #> 3 Afghan… AF AFG 4 Eastern Me… 2002 22600770 189 #> 4 Afghan… AF AFG 4 Eastern Me… 2003 23680871 189 #> 5 Afghan… AF AFG 4 Eastern Me… 2004 24726684 189 #> 6 Afghan… AF AFG 4 Eastern Me… 2005 25654277 189 #> # … with 71 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>, cfr_pct <int>, #> # cfr_pct_lo <int>, cfr_pct_hi <int>, 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 <dbl>, #> # e_rr_in_notified_labconf_pulm <int>, #> # e_rr_in_notified_labconf_pulm_lo <int>, #> # e_rr_in_notified_labconf_pulm_hi <int>, measure <chr>, unit <chr>, #> # age_group <chr>, sex <chr>, risk_factor <chr>, inc_age_sex <int>, #> # inc_age_sex_lo <int>, inc_age_sex_hi <int>
## 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])
#> Incidence by age and sex data is experimental and may cause issues for other #> datasets. Use with caution! #> Open an issue here if you run into problems: https://github.com/seabbs/getTBinR/issues
head(tb_with_latents)
#> # A tibble: 6 x 79 #> 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 20779953 190 #> 2 Afghan… AF AFG 4 Eastern Me… 2001 21606988 189 #> 3 Afghan… AF AFG 4 Eastern Me… 2002 22600770 189 #> 4 Afghan… AF AFG 4 Eastern Me… 2003 23680871 189 #> 5 Afghan… AF AFG 4 Eastern Me… 2004 24726684 189 #> 6 Afghan… AF AFG 4 Eastern Me… 2005 25654277 189 #> # … with 71 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>, cfr_pct <int>, #> # cfr_pct_lo <int>, cfr_pct_hi <int>, 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 <dbl>, #> # e_rr_in_notified_labconf_pulm <int>, #> # e_rr_in_notified_labconf_pulm_lo <int>, #> # e_rr_in_notified_labconf_pulm_hi <int>, measure <chr>, unit <chr>, #> # age_group <chr>, sex <chr>, risk_factor <chr>, inc_age_sex <int>, #> # inc_age_sex_lo <int>, inc_age_sex_hi <int>