viewGroups: View Group Averages

Description Usage Arguments Author(s) See Also Examples

View source: R/plot.R

Description

plot grouped wells as summary plots, incl. means and confidence intervals. This function gives a first overview of the reproducability between replicates.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
viewGroups(
  data,
  yids,
  stats = "CI",
  groups,
  groups2,
  xid,
  xscale = FALSE,
  xlim,
  xlab,
  dtype = "data",
  ylab,
  pcols,
  group2.col,
  yscale = TRUE,
  ylims,
  ylim,
  log = "",
  lty.mean = 1,
  lwd.mean = 2,
  alpha = 55,
  lty.orig = 1,
  lwd.orig = 0.1,
  show.ci95 = FALSE,
  show.mean = TRUE,
  emphasize.mean = FALSE,
  g2.legpos = "topleft",
  g2.legend = TRUE,
  embed = FALSE,
  no.par = FALSE,
  mai = c(0.5, 0, 0, 0),
  xmgp = c(1.5, 0.5, 0),
  ymgp = c(0, -1, -0.05),
  ytcl = 0.25,
  nrow = 1,
  xaxis = TRUE,
  yaxis = c(1, 2),
  g1.legpos = "topright",
  g1.legend = TRUE,
  verb = FALSE
)

Arguments

data

the platereader data object as provided by readPlateData

yids

IDs of the data to be plotted; if missing, all data will be plotted

stats

type of replicate statistics to plot, where replicates are defined in option groups2 or defined in the plate data object. Options are either only a line for each replicate group ("mean" or "median") or a line with transparent ranges. "CI": mean and 95% confidence interval (default), "SD": mean and standard deviation, "SE": mean and standard error, "boxplot": median and 25% and 75% quantiles, "range": median and full data range (min/max)

groups

a list of well groups, wells from each group will be plotted together in one plot, and statistics plotted for sub-groups (replicates) in groups2. Groupings can also be present as a list item in the data object.

groups2

replicate well groups for which statistics are calculated and plotted (see argument stats), each group must be a subset of exactly on well group in argument groups.

xid

ID of a data-set in the input data that can be used as x-axis instead of the default Time vector

xscale

use a global range for the x-axes; only relevant if xid specifies a subset of the data as x-axis

xlim

plot range of the x-axis

xlab

custom x-axis label

dtype

type of the data to be plotted, default is the main 'data', but e.g. 'orig' allows to plot the original data w/o processing (e.g. interpolation, blank correction, etc.)

ylab

custom y-axis label

pcols

a named list of RGB colors to be used the plotted data types; the color vector must have names according to the data IDs

group2.col

a named list of RGB colors for group2 (which are shown in one plot)

yscale

if TRUE (default) global y-axis limits will be calculated from all plotted wells; if FALSE each well be locally scaled

ylims

a named list of y-axis ranges pairs for each data ID

ylim

one y-axis limit range that will be used for all plotted data

log

plot logarithmic axis, use equivalent to normal plot 'log', i.e., log="y" for a log y-axis, log="x" for x-axis and log="yx" for both axes

lty.mean

line style for the mean lines, see (par("lty") this can help to emphasize the means in noisy data (broad overlapping confidence intervals

lwd.mean

line width for the mean lines, see (par("lwd")

alpha

hexadecimal alpha value for range plot opaqueness

lty.orig

line type of the original single data, set to 0 to supress plotting of all original data

lwd.orig

line-width of the original single data, set to 0 to supress plotting of all original data

show.ci95

deprecated, but kept for backward compatibility, see option stats="CI": show the 95% condifence intervals of groups; set stats="mean" to reproduce previous show.ci95=FALSE behaviour

show.mean

show the mean of groups as lines

emphasize.mean

show the means in black instead of group colors,

g2.legpos

position of the groups2 legend, see g2.legend

g2.legend

plot a legend for groups in argument groups2

embed

setting TRUE allows to embed plots of single groups within in layouted plots, see ?layout and par("mfcol"); also see argument no.par

no.par

setting TRUE supresses all internal plot defaults (e.g., mai, mgp), useful to style your own plots, also see argument embed

mai

set the outer margins around plot areas, see ?par

xmgp

x-axis mgp settings: margin line in mex units of axis title, tick labels and axis line; used only if no.par==FALSE

ymgp

y-axis mgp settings: margin line in mex units of axis title, tick labels and axis line

ytcl

y-axis tcl settings: tick length and direction

nrow

number of plot rows, number of columns will be selected automatically; NOTE: to change the ordering of the plots you can change the ordering of the input groups/

xaxis

plot x-axis if TRUE

yaxis

the data types for which axes are to be plotted, corresponds to the order in argument yids and as plotted in the legend (see argument g1.legend

g1.legpos

position of the groups legend, see g1.legend

g1.legend

show the main legend, giving plot colors

verb

print progress messages

Author(s)

Rainer Machne raim@tbi.univie.ac.at

See Also

viewPlate, getGroups, readPlateMap

Examples

1
2
3
4
data(ap12)
groups <- getGroups(plate=ap12plate, by=c("strain"))
vg <- viewGroups(ap12data,groups=groups,lwd.orig=0.1,nrow=1)
vg <- viewGroups(ap12data,groups2=groups,lwd.orig=0.1,nrow=1)

raim/platexpress documentation built on Jan. 18, 2022, 1:41 p.m.