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.

reref_eeg(data, ...)

# S3 method for default
reref_eeg(data, ...)

# S3 method for eeg_data
reref_eeg(data, ref_chans = "average",
  exclude = NULL, robust = FALSE, ...)

Arguments

data

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

...

Further parameters to be passed to reref_eeg

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.

Value

object of class eeg_data, re-referenced as requested.

Methods (by class)

  • default: Default method

  • eeg_data: Rereference objects of class eeg_data

Examples

# demo_epochs is average referenced by default demo_epochs
#> Epoched EEG data #> #> Number of channels : 11 #> Number of epochs : 80 #> Epoch limits : -0.1972656 - 0.4511719 seconds #> Electrode names : A5 A13 A21 A29 A31 B5 B6 B8 B16 B18 B26 #> Sampling rate : 128 Hz
# Rereference it but exclude B5 from calculation of the average reref_eeg(demo_epochs, exclude = "B5")
#> Epoched EEG data #> #> Number of channels : 11 #> Number of epochs : 80 #> Epoch limits : -0.1972656 - 0.4511719 seconds #> Electrode names : A5 A13 A21 A29 A31 B5 B6 B8 B16 B18 B26 #> Sampling rate : 128 Hz
# Reference data using the median of the reference channels rather than the mean reref_eeg(demo_epochs, robust = TRUE)
#> Epoched EEG data #> #> Number of channels : 11 #> Number of epochs : 80 #> Epoch limits : -0.1972656 - 0.4511719 seconds #> Electrode names : A5 A13 A21 A29 A31 B5 B6 B8 B16 B18 B26 #> Sampling rate : 128 Hz