Skip to contents

Returns indices of channels matching specified types.

Usage

getChannelsByType(x, types)

Arguments

x

A PhysioExperiment object.

types

Character vector of channel types to match.

Value

Integer vector of matching channel indices.

References

Oostenveld R, Fries P, Maris E, Schoffelen JM (2011). "FieldTrip: Open source software for advanced analysis of MEG, EEG, and invasive electrophysiological data." Computational Intelligence and Neuroscience, 2011, 156869.

See also

setChannelTypes for assigning channel types, pickChannels for subsetting by channel, dropChannels for removing channels

Examples

pe <- PhysioExperiment(
  assays = list(raw = matrix(rnorm(400), nrow = 100, ncol = 4)),
  colData = S4Vectors::DataFrame(
    label = c("Fz", "EOG1", "EMG1", "Oz"),
    type = c("EEG", "EOG", "EMG", "EEG")
  ),
  samplingRate = 100
)

# Get EEG channels
eeg_idx <- getChannelsByType(pe, "EEG")  # c(1, 4)