plot.MEA: Plots an object of class 'MEA'

View source: R/rMEA_graphics.R

plot.MEAR Documentation

Plots an object of class MEA

Description

Plots an object of class MEA

Usage

## S3 method for class 'MEA'
plot(x, from = 0, to = NULL, duration = NULL, ccf = F, rescale = F, ...)

Arguments

x

an object of class MEA (see function readMEA).

from

either an integer or a string in the format hh:mm:ss or mm:ss representing the starting second.

to

if duration is not specified, either an integer or a string in the format hh:mm:ss or mm:ss representing the ending second.

duration

if to is not specified, either an integer or a string in the format hh:mm:ss or mm:ss representing the amount of seconds to be plotted.

ccf

either FALSE or a string representing the type of ccf to be overlayed. One of "all_lags" "s1_lead" "s2_lead" "lag_zero" "s1_lead_0" "s2_lead_0" "bestLag" "grandAver" "winTimes".

rescale

logical. Should the motion energy time-series be rescaled?

...

further arguments passed to plot

Details

Note: if more of than 10s of trailing zeroes are found at the end of both s1 and s2 signals they are truncated.

Examples

## read a single file
path_normal <- system.file("extdata/normal/200_01.txt", package = "rMEA")
mea_normal <- readMEA(path_normal, sampRate = 25, s1Col = 1, s2Col = 2,
                     s1Name = "Patient", s2Name = "Therapist", skip=1,
                     idOrder = c("id","session"), idSep="_")
mea_normal <- MEAccf(mea_normal, lagSec = 5, winSec = 30, incSec = 10, ABS = FALSE)
## Visual inspection of the data
plot(mea_normal[[1]], from = 60, to = "2:00")
plot(mea_normal[[1]], from = 0, duration = "5:00")

#' ## Visualize CCF inspection of the data
plot(mea_normal[[1]], from = 0, duration = "2:00", ccf = "lag_zero", rescale=TRUE)


rMEA documentation built on March 18, 2022, 5:41 p.m.