search_data_dict: Search the WHO TB Data Dictionary by Variable Name.

Description Usage Arguments Value See Also Examples

View source: R/search_data_dict.R

Description

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

Usage

1
2
3
search_data_dict(var = NULL, def = NULL, dict = NULL,
  download_data = TRUE, save = TRUE, dict_save_name = "TB_data_dict",
  verbose = TRUE, ...)

Arguments

var

A character vector of variable names.

def

A character vector of terms to use to search the variable definitions for partial matches

dict

A tibble of the data dictionary. See get_data_dict for details. If not supplied the function will attempt to load a saved version of the dictionary. If this fails and download_data = TRUE then the dictionary will be downloaded.

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.

dict_save_name

Character string, name to save dictionary under. Defaults to TB_data_dict.

verbose

Logical, defaults to TRUE. Should search information be returned.

...

Additional parameters to pass to get_data_dict.

Value

A tibble containing the information in the data dictionary matching the variables searched for.

See Also

get_data_dict

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Search for a known variable
## Download and save the dictionary if it is not available locally
search_data_dict(var = "country")

## Search for all variables mentioning mortality in their definition
search_data_dict(def = "mortality")

## 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")

getTBinR documentation built on Nov. 16, 2018, 1:17 a.m.