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 )
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 |
---|---|
download_data | Logical, defaults to |
save | Logical, should the data be saved for reuse during the current R session. Defaults to
|
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 |
additional_datasets | A character vector specifying the names of the additional datasets to import.
See |
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 |
return | Logical, should the data be returned as a dataframe.
Defaults to |
verbose | Logical, defaults to |
use_utils | Logical, defaults to |
retry_download | Logical defaults to |
The WHO TB burden data as a tibble.
get_data search_data_dict
## Default datasets tb_burden <- get_tb_burden(additional_datasets = available_datasets$dataset[3])#>#> #>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])#>#> #>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>