Skip to contents

Interprets an ev_variables container, fetches the variable metadata from EpiVault and returns it in a data frame. Can fetch either variable level information or categorical value labels depending on the cats parameter. See Arguments and Details.

Usage

fetch_ev_meta_vars(con, ev_vars, visibility = 0, cats = FALSE)

Arguments

con

An EpiVault connection object

ev_vars

An ev_variables container

visibility

(default=0) Maximum visibility level requested. See examples.

cats

(default=FALSE) If TRUE, return categorical value labels, otherwise return variable level metadata

Value

A data frame

Details

If cats=TRUE then it returns category metadata, otherwise (default) it returns variable metadata:

variable (default)

Variable level information such as name, label, description, keywords and summary stats.

category

Value labels for categorical variables, one row per value. Returns variable name, value and label.

See also

Examples

if (FALSE) { # \dontrun{

con <- ev_connect()

# read a variable data request file
vars <- read_ev_variables("path/to/variables/file")

# fetch variable metadata from EpiVault - default visibility for standard data requests
meta <- fetch_ev_meta_vars(con, vars)

# fetch variable metadata from EpiVault - highest visibility to access sensitive variables
meta <- fetch_ev_meta_vars(con, vars, visibility = 9)

# fetch categorical metadata from EpiVault
meta <- fetch_ev_meta_vars(con, vars, cats = TRUE)

} # }