Description Usage Arguments Details Value See Also Examples
View source: R/erp_preprocess.R
baselineCorr
performs baseline correction, that is, it removes the
average of the baseline amplitudes from the data.
1 2 3 4 5 6 7 | baselineCorr(
dat,
pool_dim = "time",
sep_dim = NULL,
base_timerange = isPositive(negate. = TRUE),
return_call = TRUE
)
|
dat |
numeric vector, matrix, or array containing the ERPs |
pool_dim, sep_dim |
numeric or character vector identifying the
dimensions of |
base_timerange |
numeric or character vector, or a subsetting function
from the |
return_call |
logical value whether the function call should be returned with additional informations (default: TRUE) |
Baseline correction is a standard step in ERP preprocessing. It
means the subtraction of the average prestimulus voltage from the whole
waveform. Usually baseline correction is done separately for each channel in
each epoch, that is, each single ERP curve is corrected independently.
baselineCorr
allows to provide non-standard time windows and the
pooling of dimensions (e.g., a common baseline is computed for all
conditions).
The function returns a numeric array with the same attributes as dat.
scaleArray
for the function behind the scenes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # example dataset
data(erps)
# remove baseline activity - separately for each single time curve
# (this is the default, but we explicitly include it for now)
bc0 <- baselineCorr(erps, pool_dim = "time")
# remove baseline activity separately for each stimulus class, pairtype and
# channel in each subject
bc1 <- baselineCorr(erps, sep_dim = c("stimclass", "pairtype", "chan", "id"))
# in the present case, the two calls give the same results, because
# the ERP dataset has these five dimensions
stopifnot(all.equal(bc0, bc1, check.attributes = FALSE))
# assume that the baseline is from -50 ms to 50 (silly example)
bc3 <- baselineCorr(erps, base_timerange = isBetween(-50, 50))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.