Skip to contents

Fetches data from a single table in EpiVault and returns it as a data frame.

Usage

ev_simple_fetch(con, project, table, visibility = 0, variables = character(0))

Arguments

con

An EpiVault connection object

project

Project name

table

Table name

visibility

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

variables

(optional) Character vector of variable names. These should just be the variable (column) names, i.e. not fully qualified. If omitted, all variables are returned.

Value

A data frame containing the data requested

Examples

if (FALSE) { # \dontrun{

con <- ev_connect()

# fetch the whole table
dat <- ev_simple_fetch(con,
                       project = "project1",
                       table = "table1",
                       visibility = 0
)

# just fetch a couple of variables
# NB. variables in the table tagged as 'required' will also be returned
dat <- ev_simple_fetch(con,
                       project = "project1",
                       table = "table1",
                       visibility = 0,
                       variables = c("var11", "var13", "var44")
)

# use higher visibility level to access sensitive variables
# special database permissions may be required 
dat <- ev_simple_fetch(con,
                       project = "project1",
                       table = "table1",
                       visibility = 9,
                       variables = c("date_of_birth")
)
                       
} # }