plotTrajRibbon: Plot time series with CI ribbon

Description Usage Arguments Value Examples

View source: R/plotTrajRibbon.R

Description

A ribbon with confidence interval for the mean is plotted around the group mean. Optionally an additional curve is plotted, e.g. a stimulation time course.

Usage

1
2
3
4
5
plotTrajRibbon(dt.arg, x.arg, y.arg, group.arg = NULL, col.arg = NULL,
  dt.stim.arg = NULL, stim.x.arg, stim.y.arg,
  ribbon.lohi.arg = c("Lower", "Upper"), ribbon.fill.arg = "grey50",
  ribbon.alpha.arg = 0.5, xlab.arg = NULL, ylab.arg = NULL,
  plotlab.arg = NULL)

Arguments

dt.arg

Data table in long format with mean time series and upper and lower bound for the CI

x.arg

String with column name of x-axis data (default: Metadata_RealTime)

y.arg

String with column name of y-axis data (default: Mean)

group.arg

String with column name of the grouping variable for trajectories (default: Metadata_Well).

col.arg

Vector with string elements with colour palette for time series curves (default: NULL).

dt.stim.arg

Data table with stimulation time series (default: NULL).

stim.x.arg

String with column name of x-axis of dt.stim.arg.

stim.y.arg

String with column name of y-axis of dt.stim.arg.

xlab.arg

String with x-axis label

ylab.arg

String with y-axis label

plotlab.arg

String with plot title

Value

ggplot2 plot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
require(tca)

# generate synthetic time series
dt = genTraj()

# clculate 90% CI
dt.aggr = calcTrajCI(in.dt = dt, in.col.meas = 'objNuc_Intensity_MeanIntensity_imErkCor', in.col.by = 'Metadata_Site', in.type = 'normal', conf.int = 0.9)

# plot each group in a separate facet; add population mean
plotTrajRibbon(dt.arg = dt.aggr, x.arg = 'Metadata_RealTime', y.arg = 'Mean')

dmattek/tca-package documentation built on Dec. 10, 2019, 4:10 p.m.