gtoxLoadChem: Load sample/chemical information

Description Usage Arguments Details Value Examples

View source: R/gtoxLoadChem.R

Description

gtoxLoadChem queries the gtox database and returns the chemcial information for the given field and values.

Usage

1
2
gtoxLoadChem(field = NULL, val = NULL, exact = TRUE,
include.spid = TRUE)

Arguments

field

Character of length 1, the field to query on

val

Vector of values to subset on

exact

Logical, should chemical names be considered exact?

include.spid

Logical, should spid be included?

Details

The 'field' parameter is named differently from the 'fld' parameter seen in other functions because it only takes one input.

The functionality of the 'exact' parameter cannot be demonstrated within the SQLite environment. However, in the MySQL environment the user should be able to give parital chemcial name strings, to find chemicals with similar names. For example, setting 'val' to "phenol" when 'field' is "chnm" and 'exact' is FALSE might pull up the chemicals "mercury". More technically, setting 'exact' to FALSE passes the string in 'val' to an RLIKE statement within the MySQL query.

Value

A data.table with the chemical information for the given parameters

Examples

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

## Passing no parameters gives all of the registered chemicals with their
## sample IDs
gtoxLoadChem()

## Or the user can exclude spid and get a unique list of chemicals
gtoxLoadChem(include.spid = FALSE)

## Other examples:
gtoxLoadChem(field = "chnm", val = "chromium")

## Reset configuration
options(conf_store)

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