R/search_data_dict.R
search_data_dict.Rd
Searches the WHO data dictionary for TB burden data. When run for the first time
it will download the data dictionary, if download_data = TRUE
, and save it into the temporary
search_data_dict(var = NULL, def = NULL, dataset = NULL, dict = NULL, download_data = TRUE, save = TRUE, dict_save_name = NULL, verbose = TRUE, ...)
var | A character vector of variable names. |
---|---|
def | A character vector of terms to use to search the variable definitions for partial matches. |
dataset | A character vector of terms to use to search the dataset names for partial matches. |
dict | A tibble of the data dictionary. See |
download_data | Logical, defaults to |
save | Logical, should the data be saved for reuse during the current R session. Defaults to
|
dict_save_name | Character string, name to save dictionary under. This argument is depreciated and will be removed from future releases. Dataset naming is now handled internally. |
verbose | Logical, defaults to |
... | Additional parameters to pass to |
A tibble containing the information in the data dictionary matching the variables
searched for. If nothing is found then NULL
is returned.
get_data_dict
## Search for a known variable ## Download and save the dictionary if it is not available locally search_data_dict(var = "country")#>#>#> # A tibble: 1 x 4 #> variable_name dataset code_list definition #> <chr> <chr> <chr> <chr> #> 1 country Country identification "" Country or territory name## Search for all variables mentioning mortality in their definition search_data_dict(def = "mortality")#>#>#> # A tibble: 9 x 4 #> variable_name dataset code_list definition #> <chr> <chr> <chr> <chr> #> 1 e_mort_100k Estimat… "" Estimated mortality of TB cases (all fo… #> 2 e_mort_100k_hi Estimat… "" Estimated mortality of TB cases (all fo… #> 3 e_mort_100k_lo Estimat… "" Estimated mortality of TB cases (all fo… #> 4 e_mort_exc_tbhiv_… Estimat… "" Estimated mortality of TB cases (all fo… #> 5 e_mort_exc_tbhiv_… Estimat… "" Estimated mortality of TB cases (all fo… #> 6 e_mort_exc_tbhiv_… Estimat… "" Estimated mortality of TB cases (all fo… #> 7 e_mort_tbhiv_100k Estimat… "" Estimated mortality of TB cases who are… #> 8 e_mort_tbhiv_100k… Estimat… "" Estimated mortality of TB cases who are… #> 9 e_mort_tbhiv_100k… Estimat… "" Estimated mortality of TB cases who are…## Search for all variables in the Estimates dataset. search_data_dict(dataset = "Estimates")#>#>#> # A tibble: 65 x 4 #> variable_name dataset code_list definition #> <chr> <chr> <chr> <chr> #> 1 c_cdr Estimates "" Case detection rate (all forms) [also know… #> 2 c_cdr_hi Estimates "" Case detection rate (all forms) [also know… #> 3 c_cdr_lo Estimates "" Case detection rate (all forms) [also know… #> 4 c_newinc_100k Estimates "" Case notification rate, which is the total… #> 5 cfr Estimates "" Estimated TB case fatality ratio #> 6 cfr_hi Estimates "" Estimated TB case fatality ratio: high bou… #> 7 cfr_lo Estimates "" Estimated TB case fatality ratio: low bound #> 8 cfr_pct Estimates "" Estimated TB case fatality ratio expressed… #> 9 cfr_pct_hi Estimates "" Estimated TB case fatality ratio: high bou… #> 10 cfr_pct_lo Estimates "" Estimated TB case fatality ratio: low boun… #> # … with 55 more rows## Search for both a known variable and for mortality being mentioned in there definition ## Duplicate entries will be omitted. search_data_dict(var = "e_mort_exc_tbhiv_100k", def = "mortality")#>#>#>#> # A tibble: 9 x 4 #> variable_name dataset code_list definition #> <chr> <chr> <chr> <chr> #> 1 e_mort_exc_tbhiv_… Estimat… "" Estimated mortality of TB cases (all fo… #> 2 e_mort_100k Estimat… "" Estimated mortality of TB cases (all fo… #> 3 e_mort_100k_hi Estimat… "" Estimated mortality of TB cases (all fo… #> 4 e_mort_100k_lo Estimat… "" Estimated mortality of TB cases (all fo… #> 5 e_mort_exc_tbhiv_… Estimat… "" Estimated mortality of TB cases (all fo… #> 6 e_mort_exc_tbhiv_… Estimat… "" Estimated mortality of TB cases (all fo… #> 7 e_mort_tbhiv_100k Estimat… "" Estimated mortality of TB cases who are… #> 8 e_mort_tbhiv_100k… Estimat… "" Estimated mortality of TB cases who are… #> 9 e_mort_tbhiv_100k… Estimat… "" Estimated mortality of TB cases who are…