ci_plot {opm}R Documentation

Plot point estimates with CIs

Description

Draw point estimates with their confidence intervals. Used for comparing aggregated values together with their confidence intervals between plates. This method can in most cases not be applied to entire plates but to selected wells only.

Usage

  ## S4 method for signature 'MOPMX'
ci_plot(object, ...) 
  ## S4 method for signature 'OPMS'
ci_plot(object, as.labels,
    subset = opm_opt("curve.param"), ...) 
  ## S4 method for signature 'data.frame'
ci_plot(object, rowname.sep = " ",
    prop.offset = 0.04, align = "center", col = "blue", na.action = "warn",
    draw.legend = TRUE, legend.field = c(1, 1), x = "topleft", xpd = TRUE,
    vline = 0, split.at = param_names("split.at"), crr = 0.75, ...) 

Arguments

object

OPMS or MOPMX object or (rarely) a data frame. If an OPMS object, it is in most cases necessary to restrict the plates to at most about one dozen wells. See [ for how to achieve this. This also means that care should be taken when applying this function to a MOPMX object.

The data frame method is not normally directly called by an opm user but via the OPMS method, unless it is used after extract was applied to a data frame for calculating point estimates and confidence intervals from groups of observations. See there for details.

Otherwise, the data frame should be as exported by the OPMS method of extract with ci set to TRUE. There must be a column named param_names("split.at") followed by columns with only numeric values. Columns before that split column, if any, are used for grouping. The rows must entirely comprise triplets representing (i) the point estimate, (ii) the lower and (iii) the upper confidence interval.

as.labels

List. Metadata to be joined and used to draw a legend. Ignored if NULL.

subset

Character scalar. The parameter to plot. Only a single one can be selected. See param_names for the options.

rowname.sep

Character scalar. Used when joining explanatory columns into row labels of the plots.

prop.offset

Numeric scalar. A proportional offset that is added to the vertical range of the panels (after determining the maximum range among all panels to ensure consistency within the plot).

align

Character scalar. How to apply the offset; in addition to the default, ‘left’ and ‘right’ are possible.

col

Character scalar. Colour to be used.

na.action

Character scalar. What to do if a confidence interval contains NA values; one of ‘ignore’, ‘warn’ and ‘error’.

draw.legend

Logical scalar. Ignored if there are no explanatory columns.

legend.field

Two-element numeric vector. Indicates the panel in which the legend is drawn. Subsequent arguments work then relative to this panel. If legend.field has less then two fields, the number of panels is set to 1 (the entire plot), and the legend is drawn relative to that.

x

Legend position, passed to legend from the graphics package. Ignored unless draw.legend is TRUE.

xpd

Logical scalar. Also passed to that function.

vline

Numeric scalar with the position on the y-axis of a vertical line to be drawn. Ignored if NULL.

crr

Numeric scalar (column-row-ratio) interpreted as number of columns per number of rows. Determines the arrangement of the subplots.

...

Optional arguments passed to legend, or arguments passed between the methods.

split.at

Character vector. See extract.

Details

The default placement of the legend is currently not necessarily very useful. When plotting entire PM plates, the ‘mar’ parameter of par most likely would need to be set to a lower value, but it is recommended to plot only subsets of plates, i.e. selected wells.

Value

Character vector describing the plot's legend, returned invisibly, or list of such vectors.

References

Vaas LAI, Sikorski J, Michael V, Goeker M, Klenk H-P. 2012 Visualization and curve parameter estimation strategies for efficient exploration of Phenotype Microarray kinetics. PLoS ONE 7, e34846.

See Also

graphics::plot

Other plotting-functions: heat_map, level_plot, parallel_plot, parallelplot, radial_plot, summary, xy_plot

Examples

x <- ci_plot(vaas_4[, , 1:3], as.labels = list("Species", "Strain"),
  subset = "A", x = "bottomright", legend.field = NULL)

plot of chunk unnamed-chunk-1

# note that the values on the y axes are drawn to scale
x
## [1] "1: Escherichia coli DSM18039"      "2: Escherichia coli DSM30083T"    
## [3] "3: Pseudomonas aeruginosa 429SC1"  "4: Pseudomonas aeruginosa DSM1707"
stopifnot(is.character(x), identical(length(x), 4L))
# ... and that the return value contains the legend (even if it is not drawn)

## See also the examples for the data-frame method of extract().

[Package opm version 1.3.63 Index]