eeg_reference: Referencing

View source: R/data_modifiers.R

eeg_referenceR Documentation

Referencing

Description

Used to reference the EEG data to a specified electrode or electrodes. Defaults to average reference. When specific electrodes are used, they are removed from the data. Meta-data about the referencing scheme is held in the eeg_data structure.

Usage

eeg_reference(data, ...)

## Default S3 method:
eeg_reference(data, ...)

## S3 method for class 'eeg_data'
eeg_reference(
  data,
  ref_chans = "average",
  exclude = NULL,
  robust = FALSE,
  implicit_ref = NULL,
  verbose = TRUE,
  ...
)

## S3 method for class 'eeg_epochs'
eeg_reference(
  data,
  ref_chans = "average",
  exclude = NULL,
  robust = FALSE,
  implicit_ref = NULL,
  verbose = TRUE,
  ...
)

reref_eeg(data, ...)

Arguments

data

Data to re-reference. Primarily meant for use with data of class eeg_data.

...

Further parameters to be passed to eeg_reference

ref_chans

Channels to reference data to. Defaults to "average" i.e. average of all electrodes in data. Character vector of channel names or numbers.

exclude

Electrodes to exclude from average reference calculation.

robust

Use median instead of mean; only used for average reference. Defaults to FALSE.

implicit_ref

Implicit reference channel - use this to add a channel back that was previously used as a reference. E.g. if the LM (left mastoid) channel was used in recording and is absent from the data, passing "LM" adds an "LM" channel back to the data, populated with zeroes.

verbose

Print informative messages in console. Defaults to TRUE.

Value

object of class eeg_data, re-referenced as requested.

Methods (by class)

  • default: Default method

  • eeg_data: Rereference objects of class eeg_data

  • eeg_epochs: Rereference objects of class eeg_epochs

Author(s)

Matt Craddock matt@mattcraddock.com

Examples

# demo_epochs is average referenced by default
demo_epochs
# Rereference it but exclude B5 from calculation of the average
eeg_reference(demo_epochs, exclude = "B5")
# Reference data using the median of the reference channels rather than the mean
eeg_reference(demo_epochs, robust = TRUE)

eeg_reference(demo_spatial)
eeg_reference(demo_spatial, ref_chans = "Fz")
eeg_reference(demo_spatial, implicit_ref = "LM")

craddm/eegUtils documentation built on March 24, 2022, 9:17 a.m.