lines.MEA: Adds lines of a 'MEA' object to a Plot

View source: R/rMEA_graphics.R

lines.MEAR Documentation

Adds lines of a MEA object to a Plot

Description

Adds lines of a MEA object to a Plot

Usage

## S3 method for class 'MEA'
lines(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. Possible values can be found with the ccfResNames function.

rescale

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

...

further arguments passed to lines

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)
mea_smoothed <- MEAsmooth(mea_normal)
## Visual inspection of the data
plot(mea_normal[[1]], from = 240, duration=20)
lines(mea_smoothed[[1]], from = 240, duration=20, lty=3, col=c(1,2))

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