ctd: Continuous Time Domain Data

ctdR Documentation

Continuous Time Domain Data

Description

Define the ctd object and associated methods.

Usage

ctd(x, fs, ref = NA, add.t = TRUE, ...)

## Default S3 method:
ctd(x, fs, ref = NA, add.t = TRUE, ...)

npts(object)

## S3 method for class 'ctd'
npts(object)

ns(object)

## S3 method for class 'ctd'
ns(object)

fs(object)

## S3 method for class 'ctd'
fs(object)

ref(object)

## S3 method for class 'ctd'
ref(object)

## S3 method for class 'ctd'
print(x, ...)

## S3 method for class 'ctd'
summary(object, ...)

## S3 method for class 'summary.ctd'
print(x, ...)

## S3 method for class 'ctd'
plot(x, sensors = 1:ns(x), xlim = c(0, 10), ylim = c(-50, 50), ...)

Arguments

x

name of a matrix that contains the data, or an object that can be coerced to a matrix, consisting of npts data points as rows, and ns signals as columns.

fs

the sampling frequency in Hertz.

ref

names or numbers of reference sensors, "avg" or "average" for average reference. Default: NA

add.t

flag indicating whether to add a time variable to the matrix

...

other arguments

object

Object

sensors

Numeric. Sensors to plot (default 1:ns)

xlim

Numeric. Lower and upper limits of plot X-axis (default: 0,10)

ylim

Numeric. Lower and upper limits of plot Y-axis (default: -50,50)

Details

The ctd object can be used to store continuous time domain data. A ctd object is a numeric matrix with attributes:

fs

sampling frequency

ns

number of signals/channels, (columns of the matrix)

npts

the number of data points/samples (rows of the matrix)

ref

names or numbers of reference sensors

Methods exist to print, summarize, and plot the data.

Value

A ctd object, a numeric matrix with attributes fs, ns, and npts. If the input matrix does not have column names, the columns will be named S1 ... Snpts. An additional variable t containing time points will be generated if not present already and add.t = TRUE

Author(s)

Geert van Boxtel, G.J.M.vanBoxtel@gmail.com

Examples

# simulate some rather silly data that could look like EEG (2 channels)
# assume 2 seconds of data sampled at 100 Hz
C3 <- arima.sim(list(order = c(1,1,0), ar = 0.7), n = 199)+(10*rnorm(200))
C4 <- arima.sim(list(order = c(1,1,0), ar = 0.7), n = 199)+(10*rnorm(200))
eeg <- ctd(cbind(C3,C4), 100)
print(eeg)
summary(eeg)


gjmvanboxtel/eegr documentation built on May 20, 2023, 4:26 a.m.