Segments continuous 2D EEG data into fixed-length epochs around events, producing a 3D array (time x channels x epochs). Optionally performs baseline correction by subtracting the mean of a pre-stimulus window.
Arguments
- x
A PhysioExperiment object with continuous (2D) data.
- events
A data.frame with an
onset_seccolumn specifying event times in seconds, OR an integer vector of sample indices.- limits
Numeric vector of length 2 specifying the epoch window relative to each event in seconds (default:
c(-0.2, 0.8)).- baseline
Numeric vector of length 2 specifying the baseline window relative to each event in seconds (default:
c(-0.2, 0)). Set to NULL to skip baseline correction.- assay_name
Name of the assay to epoch. If NULL, uses
defaultAssay(x).- output_assay
Name of the output assay (default:
"epoched").