select_elecs: Select electrodes from a given dataset

View source: R/data_selection.R

select_elecsR Documentation

Select electrodes from a given dataset

Description

This is a generic function for selection of electrodes from an EEG dataset.

Usage

select_elecs(data, ...)

## Default S3 method:
select_elecs(data, electrode = NULL, keep = TRUE, ...)

## S3 method for class 'eeg_data'
select_elecs(data, electrode, keep = TRUE, df_out = FALSE, ...)

## S3 method for class 'eeg_evoked'
select_elecs(data, electrode = NULL, keep = TRUE, df_out = FALSE, ...)

## S3 method for class 'eeg_ICA'
select_elecs(data, component, keep = TRUE, df_out = FALSE, ...)

## S3 method for class 'eeg_tfr'
select_elecs(data, electrode, keep = TRUE, df_out = FALSE, ...)

Arguments

data

An EEG dataset.

...

Arguments used with related methods

electrode

A character vector of electrode labels for selection or removal.

keep

Defaults to TRUE. Set to false to remove the selected electrodes.

df_out

Defaults to FALSE. Set to TRUE to return a dataframe rather than an eeg_data object.

component

Component to select

Value

Data frame with only data from the chosen electrodes

eeg_data object with selected electrodes removed/kept.

Methods (by class)

  • default: Select electrodes from a generic data frame.

  • eeg_data: Select electrodes from a eeg_data object.

  • eeg_evoked: Select electrode from an eeg_evoked object

  • eeg_ICA: Select components from eeg_ICA objects.

  • eeg_tfr: Select electrodes from eeg_tfr objects.

Author(s)

Matt Craddock, matt@mattcraddock.com

See Also

select_times() and select_epochs()

Other Data selection functions: select_times()

Examples

names(demo_epochs$signals)
keep_A5 <- select_elecs(demo_epochs, electrode = "A5")
remove_A5 <- select_elecs(demo_epochs, electrode = "A5", keep = FALSE)

select_elecs(demo_epochs, c("A21", "A29"))

neuroconductor/eegUtils documentation built on Feb. 3, 2023, 5:33 p.m.