tcplLoadChem | R Documentation |
tcplLoadChem
queries the tcpl database and returns the chemical
information for the given field and values.
tcplLoadChem(field = NULL, val = NULL, exact = TRUE, include.spid = TRUE)
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? |
The 'field' parameter is named differently from the 'fld' parameter seen in other functions because it only takes one input.
In the MySQL environment the user should be able to give partial
chemical 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 "Bisphenol A" and
"4-Butylphenol". More technically, setting 'exact' to FALSE
passes
the string in 'val' to an RLIKE statement within the MySQL query.
A data.table with the chemical information for the given parameters
## Not run:
## Passing no parameters gives all of the registered chemicals with their
## sample IDs
tcplLoadChem()
## Or the user can exclude spid and get a unique list of chemicals
tcplLoadChem(include.spid = FALSE)
## In addition, the user can retrieve only the registered chemicals from the chemical table
tcplLoadChem(field = 'chem.only')
## Other examples:
tcplLoadChem(field = "chnm", val = "Bisphenol A")
tcplLoadChem(field = "chid", val = 20182)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.