gtoxLoadData: Load gtox data

Description Usage Arguments Details Value See Also Examples

View source: R/gtoxLoadData.R

Description

gtoxLoadData queries the gtox databases and returns a data.table with data for the given level and data type.

Usage

1
gtoxLoadData(lvl, fld = NULL, val = NULL, type = "mc")

Arguments

lvl

Integer of length 1, the level of data to load

fld

Character, the field(s) to query on

val

List, vectors of values for each field to query on. Must be in the same order as 'fld'.

type

Character of length 1, the data type, "sc" or "mc"

Details

The data type can be either 'mc' for mutliple concentration data, or 'sc' for single concentration data. Multiple concentration data will be loaded into the 'mc' tables, whereas the single concentration will be loaded into the 'sc' tables.

Setting 'lvl' to "agg" will return an aggregate table containing the m4id with the concentration-response data and m3id to map back to well-level information.

Leaving fld NULL will return all data.

Valid fld inputs are based on the data level and type:

type lvl Queried tables
sc 0 sc0
sc 1 sc0, sc1
sc agg sc1, sc2_agg
sc 2 sc2
mc 0 mc0
mc 1 mc0, mc1
mc 2 mc0, mc1, mc2
mc 3 mc0, mc1, mc3
mc agg mc3, mc4_agg
mc 4 mc4
mc 5 mc4, mc5
mc 6 mc4, mc6

Value

A data.table containing data for the given fields.

See Also

gtoxQuery, data.table

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Store the current config settings, so they can be reloaded at the end
## of the examples
conf_store <- gtoxConfList()
gtoxConfDefault()

## Load all of level 0 for multiple-concentration data, note 'mc' is the
## default value for type
gtoxLoadData(lvl = 0)

## Load all of level 1 for single-concentration
gtoxLoadData(lvl = 1, type = "sc")

## List the fields available for level 1, coming from tables mc0 and mc1
gtoxListFlds(tbl = "mc0")
gtoxListFlds(tbl = "mc1")

## Load level 0 data where the well type is "t" and the concentration
## index is 3 or 4
gtoxLoadData(lvl = 1, fld = c("wllt", "cndx"), val = list("t", c(3:4)))

## Reset configuration
options(conf_store)

GladiaTOX documentation built on Nov. 15, 2020, 2:07 a.m.