Simple data fetcher
ev_simple_fetch.Rd
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.
See also
Other data request functions:
fetch_ev_data()
,
fetch_ev_meta_tabs()
,
fetch_ev_meta_vars()
,
make_ev_variables()
,
read_ev_variables()
,
write_ev_data()
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")
)
} # }