get_data_dict: Get the WHO Data Dictionary for TB Data

Description Usage Arguments Value See Also Examples

View source: R/get_data_dict.R

Description

Get the data dictionary for TB burden 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.

Usage

1
2
3
4
  get_data_dict(url = "https://extranet.who.int/tme/generateCSV.asp?ds=dictionary",
  download_data = TRUE, save = TRUE, dict_save_name = "TB_data_dict",
  return = TRUE, verbose = TRUE, use_utils = FALSE,
  retry_download = TRUE)

Arguments

url

Character string, indicating the url of the data dictionary. Default is current url.

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.

return

Logical, should the data dictionary be returned as a dataframe. Defaults to TRUE.

verbose

Logical, defaults to TRUE. 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 data dictionary as a tibble with 4 variables: variable_name, dataset, code_list, definition.

See Also

get_data search_data_dict

Examples

1
2
3
dict <- get_data_dict()

head(dict)

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