Learn R Programming

icaOcularCorrection (version 1.3)

mc.batch.icaDEN.fnc: Multicore batch processing for icaDEN.fnc.

Description

Performs multicore batch processing for icaDEN.fnc.

Usage

mc.batch.icaDEN.fnc(epoch.length = NULL, method = "by.trial", fn = NA, 
fn.path = file.path(getwd(), "data", "dataEEG", "formatted"), 
fn.pattern = "^formatted.*\.rda", fn.object.name = "eeg", begin = 1, 
finish = NA, threshold = 0.4, n.comp = 16, dir.create.path = file.path(getwd(), 
"data", "dataEEG"), dir.create.name = "ICA.denoised", fn.save.prefix = "ICA_", 
other.things.to.do = NULL, electrodes = defineElectrodeSet.fnc()$electrodes, 
eogs = list(VEOG = c("BE", "TE"), HEOG = c("LC", "RC")), recursive = TRUE, 
ret.SAWK = TRUE, pdf.it = FALSE, pdf.prefix = "ICs_", pdf.compress = FALSE, 
verbose = TRUE, gen.log = c(TRUE, FALSE))

Arguments

epoch.length
If performing by-trial correction, then supply the length of each trial in number of data points (e.g., 192, 179). If performing ICA correction on whole data at once, do not need this (set to NULL).
method
For one subject and one electrode, either perform by-trial correction (default) or correction on the whole vector (all).
fn
The names of the .rda files to be batch processed. By default, the function will get the names of all the files in the directory provided in the "fn.path" argument.
fn.path
The path where the uncorrected .rda files are located. Set to file.path(getwd(),"data", "dataEEG","formatted") by default. Value passed to path argument of list.files.
fn.pattern
A regular expression. Only file names which match the regular expression will be returned. Default is "^formatted.*\.rda". Value passed to pattern argument of list.files.
fn.object.name
The name of the to-be-corrected object saved in the .rda files. Default is "eeg".
begin
Within the file name vector, begin the correction process at which point. Default is to begin with the first object of the vector.
finish
Within the file name vector, finish correction process as which point. Default is to finish with the last item in the file name vector.
threshold
The correlation threshold at or above which the IC will be zeroed-out. Correlation is between one IC and (a portion of) the data for one electrode. Default is 0.4. Value passed to threshold argument of icaDEN.fnc.
n.comp
Number of components. Defaults to 16. Value passed to n.comp argument of icaDEN.fnc.
dir.create.path
The path where a directory will be created, in which the corrected files will be placed. Defaults to file.path(getwd(), "data", "dataEEG").
dir.create.name
The name of the directory where the corrected files will be placed. Defaults to "ICA.denoised".
fn.save.prefix
A prefix to add in front of the name of the corrected file. Defaults to "ICA_".
other.things.to.do
You can tell the function in the form of a vector (c(...)) to performing other things before correction. For instance: c('eeg$Recalled = as.factor(eeg$Recalled)', 'eeg$LogitABCD = as.numeric(eeg$LogitABCD)').
electrodes
Supply a vector of electrodes to be corrected. The default is a vector of electrode names supplied by defineElectrodeSet.fnc$electrodes. Value supplied to electrodes argument of icaDEN.fnc.
eogs
The default is a list identifying which electrodes form the vertical EOG (VEOG) and the horizontal EOG (HEOG). Only one EOG can be supplied (e.g., list(VEOG = c("BE", "TE"))) or a vector containing the names of the EOG channels (e.g., c
recursive
Logical. Should elements of the path other than the last be created? If TRUE, like Unix's mkdir -p. Value passed to recursive argument of dir.create.
ret.SAWK
Return the S, A, W, and K matrices? Default is TRUE. Value passed to ret.SAWK argument of icaDEN.fnc.
pdf.it
Logical. Defaults to FALSE. If TRUE, the plots will be saved in a pdf file.
pdf.prefix
A prefix to add in front of the name of the corrected files. Defaults to "ICs_".
pdf.compress
Logical (defaults to FALSE). If you have the pdftk tool installed on your system, whether to compress .pdf files.
verbose
Whether you want to see a verbal indication of where in the process you are.
gen.log
Vector of logicals. If the first element of gen.log is TRUE (default), generates log of batch processing in file for each participant where the name of the file contains the name of the participant's EEG data. If the second eleme

Value

  • The function saves one .rda file for each subject containing the corrected EEG in the specified directory and pdf files if enabled.

concept

  • EEG
  • electro-encephalogram
  • electroencephalogram
  • ERP
  • event-related potentials
  • event related potentials

See Also

defineElectrodeSet.fnc; icaDEN.fnc; batch.icaDEN.fnc; eeg; den; plotICs.fnc; batch.plotICs.fnc