ctd | R Documentation |
Define the ctd
object and associated methods.
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), ...)
x |
name of a matrix that contains the data, or an object that can be
coerced to a matrix, consisting of |
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 |
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) |
The ctd
object can be used to store continuous time
domain data.
A ctd
object is a numeric matrix with attributes:
sampling frequency
number of signals/channels, (columns of the matrix)
the number of data points/samples (rows of the matrix)
names or numbers of reference sensors
Methods exist to print, summarize, and plot the data.
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
Geert van Boxtel, G.J.M.vanBoxtel@gmail.com
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.