tcplPlot: #—————— Generic Plotting Function for tcpl

View source: R/tcplPlot.R

tcplPlotR Documentation

#——————————————————————————- Generic Plotting Function for tcpl

Description

tcplPlot queries the tcpl databases and returns a plot for the given level and data type.

Usage

tcplPlot(
  dat = NULL,
  type = "mc",
  fld = "m4id",
  val = NULL,
  compare.val = NULL,
  by = NULL,
  output = c("console", "pdf", "png", "jpg", "svg", "tiff"),
  fileprefix = paste0("tcplPlot_", Sys.Date()),
  multi = NULL,
  verbose = FALSE,
  nrow = NULL,
  ncol = NULL,
  dpi = 600,
  flags = FALSE,
  yuniform = FALSE,
  yrange = c(NA, NA)
)

Arguments

dat

data.table containing plot-prepared data, used for stand-alone (non-ToxCast data like other tcplfit2-fit data) or advanced plotting (generating comparison plots across multiple database configurations) and not required. See tcplPlotLoadData.

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

compare.val

List, vectors of values for each field to query on to compare with val. Must be in the same order as 'fld'. Must have the same length as val (1:1 comparison). Must be set to compare plots; otherwise leave NULL

by

Parameter to divide files into e.g. "aeid".

output

How should the plot be presented. To work with the plot in environment, use "ggplot"; to interact with the plot in application, use "console"; or to save as a file type, use "pdf", "jpg", "png", "svg", or "tiff".

fileprefix

Prefix of file when saving.

multi

Boolean, by default TRUE for "pdf". If multi is TRUE, output by default 4 plots per page for 'verbose' = TRUE and 6 plots per page for 'verbose' = FALSE.

verbose

Boolean, by default FALSE. If TRUE, a table with fitting parameters is included with the plot.

nrow

Integer, number of rows in multiplot. By default 2.

ncol

Integer, number of columns in multiplot. By default 3, 2 if verbose.

dpi

Integer, image print resolution. By default 600.

flags

Boolean, by default FALSE. If TRUE, level 6 flags are displayed below annotations on plot

yuniform

Boolean, by default FALSE. If TRUE, all plots will have uniform y axis scaling, automatically determined.

yrange

Integer of length 2, for directly setting the y-axis range, c(<min>,<max>). By default, c(NA,NA).

Details

The data type can be either 'mc' for multiple 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.

Leaving fld NULL will return all data.

Examples

## Not run: 
tcplPlot(fld = "m4id", val = c(18609966)) ## Create a level 4 plot

## End(Not run)

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