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
 4
 5
 6
 7
 8
 9
10
11
search_data_dict(
  var = NULL,
  def = NULL,
  dataset = NULL,
  dict = NULL,
  download_data = TRUE,
  save = TRUE,
  dict_save_name = NULL,
  verbose = FALSE,
  ...
)

Arguments

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 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. This argument is depreciated and will be removed from future releases. Dataset naming is now handled internally.

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. If nothing is found then NULL is returned.

See Also

get_data_dict

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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 all variables in the Estimates dataset.
search_data_dict(dataset = "Estimates")

## 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 July 2, 2020, 12:31 a.m.