plot.grid {QurvE} | R Documentation |
Plot a matrix of growth curve panels
Description
plot.grid
takes a grofit
or flFitRes
object and returns a facet grid of individual growth and fluorescence plots
Usage
## S3 method for class 'grid'
plot(
x,
data.type = c("spline", "raw", "norm.fl"),
param = c("mu.linfit", "lambda.linfit", "dY.linfit", "A.linfit", "mu2.linfit",
"lambda2.linfit", "mu.model", "lambda.model", "A.model", "A.orig.model", "dY.model",
"dY.orig.model", "tD.linfit", "tD2.linfit", "tD.spline", "tD2.spline", "mu.spline",
"lambda.spline", "A.spline", "dY.spline", "integral.spline", "mu2.spline",
"lambda2.spline", "mu.bt", "lambda.bt", "A.bt", "integral.bt", "max_slope.linfit",
"max_slope.spline"),
pal = c("Green", "Orange", "Purple", "Magenta", "Grey", "Blue", "Grey", "Red", "Cyan",
"Brown", "Mint"),
invert.pal = FALSE,
IDs = NULL,
sort_by_ID = FALSE,
names = NULL,
conc = NULL,
exclude.nm = NULL,
exclude.conc = NULL,
mean = TRUE,
log.y = TRUE,
n.ybreaks = 6,
sort_by_conc = TRUE,
nrow = NULL,
basesize = 20,
y.lim = NULL,
x.lim = NULL,
legend.lim = NULL,
y.title = NULL,
x.title = NULL,
lwd = 1.1,
plot = TRUE,
export = FALSE,
height = NULL,
width = NULL,
out.dir = NULL,
out.nm = NULL,
...
)
Arguments
x |
A |
data.type |
(Character) Plot either raw data ( |
param |
(Character) The parameter used to compare different sample groups. Any name of a column containing numeric values in |
pal |
(Character string) Choose one of 'Green', 'Orange', 'Purple', 'Magenta', 'Grey', 'Blue', 'Grey', 'Red', 'Cyan', 'Brown', or 'Mint' to visualize the value of the parameter chosen as |
invert.pal |
(Logical) Shall the colors in the chosen |
IDs |
(String or vector of strings) Define samples or groups (if |
sort_by_ID |
(Logical) Shall samples/conditions be ordered as entered in |
names |
(String or vector of strings) Define groups to combine into a single plot. Partial matches with sample/group names are accepted. If |
conc |
(Numeric or numeric vector) Define concentrations to combine into a single plot. If |
exclude.nm |
(String or vector of strings) Define groups to exclude from the plot. Partial matches with sample/group names are accepted. |
exclude.conc |
(Numeric or numeric vector) Define concentrations to exclude from the plot. |
mean |
(Logical) Display the mean and standard deviation of groups with replicates ( |
log.y |
(Logical) Log-transform the y-axis of the plot ( |
n.ybreaks |
(Numeric) Number of breaks on the y-axis. The breaks are generated using |
sort_by_conc |
(Logical) Shall the samples/conditions be sorted with concentrations in rows and groups in columns? |
nrow |
(Numeric) Defines the number of rows in the grid if |
basesize |
(Numeric) Base font size. |
y.lim |
(Numeric vector with two elements) Optional: Provide the lower ( |
x.lim |
(Numeric vector with two elements) Optional: Provide the lower ( |
legend.lim |
(Numeric vector with two elements) Optional: Provide the lower ( |
y.title |
(Character) Optional: Provide a title for the y-axis of the growth curve plot. |
x.title |
(Character) Optional: Provide a title for the x-axis of both growth curve and derivative plots. |
lwd |
(Numeric) Line width of the individual plots. |
plot |
(Logical) Show the generated plot in the |
export |
(Logical) Export the generated plot as PDF and PNG files ( |
height |
(Numeric) Height of the exported image in inches. |
width |
(Numeric) Width of the exported image in inches. |
out.dir |
(Character) Name or path to a folder in which the exported files are stored. If |
out.nm |
(Character) The name of the PDF and PNG files if |
... |
Additional arguments. This has currently no effect and is only meant to fulfill the requirements of a generic function. |
Value
A plot matrix with all growth curves (raw measurements or nonparametric fits) in a dataset, with replicates combined by the group averages (if mean = TRUE
) or not (mean = FALSE
).
Examples
# Create random growth data set
rnd.data1 <- rdm.data(d = 35, mu = 0.8, A = 5, label = "Test1")
rnd.data2 <- rdm.data(d = 35, mu = 0.6, A = 4.5, label = "Test2")
rnd.data <- list()
rnd.data[["time"]] <- rbind(rnd.data1$time, rnd.data2$time)
rnd.data[["data"]] <- rbind(rnd.data1$data, rnd.data2$data)
# Run growth curve analysis workflow
res <- growth.workflow(time = rnd.data$time,
data = rnd.data$data,
fit.opt = "s",
ec50 = FALSE,
export.res = FALSE,
suppress.messages = TRUE,
parallelize = FALSE)
plot.grid(res, param = "mu.spline")