parallel_plot {opm}R Documentation

Parallel plot

Description

Customised plotting of estimated curve parameter values from single or multiple PM plates using parallelplot from the lattice package with some adaptations likely to be useful for OmniLog(R) data. parallelplot is an alias of parallel_plot.

Usage

  ## S4 method for signature 'MOPMX,ANY'
parallel_plot(x, data, ...) 
  ## S4 method for signature 'MOPMX,XOPMX'
parallel_plot(x, data, ...) 
  ## S4 method for signature 'MOPMX,missing'
parallel_plot(x, data, ...) 
  ## S4 method for signature 'NULL,XOPMX'
parallel_plot(x, data, ...) 
  ## S4 method for signature 'OPMX,ANY'
parallel_plot(x, data, groups = 1L,
  panel.var = NULL, pnames = param_names(), col = opm_opt("colors"),
  strip.fmt = list(), striptext.fmt = list(), legend.fmt = list(),
  legend.sep = " ", draw.legend = TRUE, space = "top", ...) 
  ## S4 method for signature 'OPMX,XOPMX'
parallel_plot(x, data, ...) 
  ## S4 method for signature 'OPMX,missing'
parallel_plot(x, data, ...) 
  ## S4 method for signature 'formula,XOPMX'
parallel_plot(x, data, ...) 
  ## S4 method for signature 'missing,XOPMX'
parallel_plot(x, data, ...) 
  ## S4 method for signature 'vector,XOPMX'
parallel_plot(x, data, ...) 

  ## S4 method for signature 'MOPMX,ANY'
parallelplot(x, data, ...) 
  ## S4 method for signature 'MOPMX,XOPMX'
parallelplot(x, data, ...) 
  ## S4 method for signature 'MOPMX,missing'
parallelplot(x, data, ...) 
  ## S4 method for signature 'NULL,XOPMX'
parallelplot(x, data, ...) 
  ## S4 method for signature 'OPMX,ANY'
parallelplot(x, data, ...) 
  ## S4 method for signature 'OPMX,XOPMX'
parallelplot(x, data, ...) 
  ## S4 method for signature 'OPMX,missing'
parallelplot(x, data, ...) 
  ## S4 method for signature 'formula,XOPMX'
parallelplot(x, data, ...) 
  ## S4 method for signature 'missing,XOPMX'
parallelplot(x, data, ...) 
  ## S4 method for signature 'vector,XOPMX'
parallelplot(x, data, ...) 

Arguments

x

An OPMA, OPMS or MOPMX object with aggregated data. This and the following argument can swap their places.

data

Any kind of object that can be used for selecting metadata. Either NULL, a character vector, a list of character vectors or a formula indicating which metadata should be included and used to determine the shape of the plot. The next argument by default accesses the first metadata entry. If numeric, panel.var also accesses the results from applying data.

Most flexibility is available if data is a formula. For instance, as usual the J pseudo-function can be used to join metadata entries. Further, if a left part is present, this can indicate the parameters that should be plotted on the Y-axes (in place of the pnames argument; see below for further details). As usual, the right part of the formula states the meta-information to be included.

groups

Character or numerical scalar determining which metadata entry or other information, such as the well indexes, (see the examples) is used for assigning colours to the curves. If a numeric scalar, it refers to the position of the (potentially merged) metadata entry within data. If that argument were empty, a numeric groups argument would be ignored. Empty groups arguments are always ignored; the (constant) plate type is then used for creating a header.

panel.var

Character or numeric vector indicating which metadata entry or other information, such as the well indexes, (see the examples) is used for creating sub-panels. If a numeric vector, it refers to the position of the (potentially merged) metadata entry within data. If that argument were empty, a numeric panel.var argument would be ignored.

pnames

Character vector or formula to select the curve parameters for plotting. It has to comprise at least two of the names given by param_names(). If explicitly provided, this argument overrules the left side, if any, of a formula given as data argument. (But the left side, if any, of such a formula would overrule the default.)

col

Character or numerical scalar or vector. This and the following arguments work like the eponymous arguments of xy_plot. See there for details.

strip.fmt

List.

striptext.fmt

List.

legend.fmt

List.

legend.sep

Character scalar.

draw.legend

Logical scalar.

space

Character scalar.

...

Optional arguments passed to parallelplot from the lattice package or between the methods.

Details

The main application of this function is to include all four estimated curve parameters into a single comprehensive overview. This assists in addressing questions such as

Value

An object of class ‘trellis’ or list of such objects. See xyplot from the lattice package for details.

Author(s)

Lea A.I. Vaas

References

Sarkar, D. 2008 Lattice: Multivariate Data Visualization with R. New York: Springer, 265 p.

See Also

lattice::xyplot lattice::parallelplot

Other plotting-functions: ci_plot, heat_map, level_plot, radial_plot, summary, xy_plot

Examples

if ("package:lattice" %in% search())
  detach("package:lattice") # only necessary for knitr

## OPM objects

parallelplot(vaas_1)

plot of chunk unnamed-chunk-1

parallelplot(vaas_1, data = list("Species", "Strain"))

plot of chunk unnamed-chunk-1

# ... no effect on selection but on header

# value of 'groups' not found in the data: per default no metadata are used
x <- try(parallelplot(vaas_1, groups = "Species"), silent = TRUE)
stopifnot(inherits(x, "try-error"))
# same problem: metadata selected but 'groups' is not contained
x <- try(parallelplot(vaas_1, data = list("Species", "Strain"),
  groups = "missing"), silent = TRUE)
stopifnot(inherits(x, "try-error"))
# ... thus it is safer to use a positional 'groups' argument

## OPMS objects

# per default metadata are ignored
parallelplot(vaas_4[, , 1:10])

plot of chunk unnamed-chunk-1

# otherwise selecting metadata is as usual
parallelplot(vaas_4[, , 1:10], data = ~ J(Species, Strain))

plot of chunk unnamed-chunk-1

parallelplot(vaas_4[, , 1:10], data = list("Species", "Strain"))

plot of chunk unnamed-chunk-1

# value of 'groups' not found in the data: per default no metadata are used
x <- try(parallelplot(vaas_4[, , 1:10], groups = "Species"), silent = TRUE)
stopifnot(inherits(x, "try-error"))
# now 'groups' is all present but not a character scalar
x <- try(parallelplot(vaas_4[, , 1:10], data = list("Species", "Strain"),
  groups = c("Strain", "Species")), silent = TRUE)
stopifnot(inherits(x, "try-error"))
# here 'groups' is positional but beyond the last element
x <- try(parallelplot(vaas_4[, , 1:10], data = list("Species", "Strain"),
  groups = 3), silent = TRUE)
stopifnot(inherits(x, "try-error"))

# 'groups' and 'panel.var' arguments that work
parallelplot(vaas_4[, , 1:10], data = ~ J(Species, Strain),
  panel.var = "Species", groups = "Strain")

plot of chunk unnamed-chunk-1

parallelplot(vaas_4[, , 1:10], data = "Species", panel.var = "Species",
  groups = NULL)

plot of chunk unnamed-chunk-1

parallelplot(vaas_4[, , 1:10], data = list("Species", "Strain"),
  panel.var = "Species")

plot of chunk unnamed-chunk-1

# use of non-metadata information: here the names of the wells
parallelplot(vaas_4[, , 1:10], data = "Species", panel.var = "Well",
  groups = "Species")

plot of chunk unnamed-chunk-1

# selection of parameters via 'pnames'
parallelplot(vaas_4[, , 1:10], pnames = ~ A + AUC + mu,
  data = ~ Species + Strain, panel.var = "Species",
  col = c("black", "red"), groups = "Species")

plot of chunk unnamed-chunk-1

x <- try(parallelplot(vaas_4[, , 1:10], pnames = "A",
  data = ~ Species + Strain, panel.var = "Species",
  col = c("black", "red"), groups = "Species"), silent = TRUE)
stopifnot(inherits(x, "try-error")) # => at least two 'pnames' needed

# selecting the parameters via the left side of a 'data' formula
parallelplot(vaas_4[, , 1:10], data = A + AUC ~ J(Species, Strain))

plot of chunk unnamed-chunk-1

parallelplot(vaas_4[, , 1:10], data = A + AUC ~ J(Species, Strain),
  groups = "Species")

plot of chunk unnamed-chunk-1

# 'pnames' explicitly given => left side of formula ignored
parallelplot(vaas_4[, , 1:10], data = A + AUC ~ J(Species, Strain),
  pnames = c("A", "mu", "AUC"), groups = "Species")

plot of chunk unnamed-chunk-1

# again: at least two 'pnames' needed
x <- try(parallelplot(vaas_4[, , 1:10], data = AUC ~ J(Species, Strain),
  groups = "Species"), silent = TRUE)
stopifnot(inherits(x, "try-error"))

[Package opm version 1.3.63 Index]