tcplPlotLoadData: Utility function to load data for tcplPlot

View source: R/tcplPlotLoadData.R

tcplPlotLoadDataR Documentation

Utility function to load data for tcplPlot

Description

tcplPlotLoadData queries the tcpl databases and returns a data.table with data for the given field, value, level, and data type prepared in a format tcplPlot can use to generate plots.

Usage

tcplPlotLoadData(type = "mc", fld = "m4id", val, flags = FALSE)

Arguments

type

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

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'.

flags

Boolean, by default FALSE. If TRUE, level 6 flags are loaded for use in tcplPlot. Must be set to TRUE if tcplPlot 'flags' also is/will be set to TRUE

Details

This utility function is used by tcplPlot to load and prepare data from tcplLoadData for use in generating plots. It is exported for use in advanced comparison plots where users create plots using multiple data sources. After saving the response from tcplPlotLoadData, switch data source config and pass the data to tcplPlot dat parameter.

The data type can be either 'mc' for multiple concentration data, or 'sc' for single concentration data.

Value

A data.table containing plot-ready data for the given fields.

See Also

tcplPlot

Examples

## Not run: 
## load mc plot data for an entire endpoint
dat <- tcplPlotLoadData(fld = "aeid", val = 703)

## load sc plot data for an entire endpoint
dat <- tcplPlotLoadData(type = "sc", fld = "aeid", val = 703)

## load plot data for two endpoint-samples and include loading of flags
## flags must equal TRUE if tcplPlot will/does
dat <- tcplPlotLoadData(fld = c("spid", "aeid"), 
                        val = list(c("TP0000269F11", "TP0000395A09"),703),
                        flags = TRUE)
                        
## if desired, switch connections
tcplConf()

## use dat in tcplPlot
tcplPlot(dat = dat, 
         fld = c("spid", "aeid"), 
         val = list(c("TP0000269F11", "TP0000395A09"),703), 
         compare.val = list(c("LEGTV002B01", "LEGTV003A06"),703),
         output = "pdf", 
         flags = TRUE,
         fileprefix="example")

## End(Not run)


tcpl documentation built on Oct. 10, 2024, 1:07 a.m.