calculate the grandaverage of ERP data frames for graphical purposes

Share:

Description

A function to average ERP objects, i.e. data frames with timepoints in rows, electrodes in columns and amplitude values in each cell. It is used to compute the grandaverage across several subjects, for plotting purposes.

Usage

1
grandaverage(base, numbers, electrodes="all", erplist = NULL, NA.sub=TRUE)

Arguments

base

a string indicating the beginning of the name of the data.frame containing the ERP data.

numbers

the numbers of subjects to be averaged.

electrodes

a character vector indicating the electrodes on which perform the grandaverage. Default is "all", and the grandaverage is performed on all electrodes of the data frames.

erplist

a list containing ERP data frames.

NA.sub

logical. If TRUE, electrodes columns with NA are ignored in grandaverage computation. In this case, a Warning is displayed.

Value

A data frame with the values of subjects specified by the combination of base and numbers.

Note

The function keeps track of the averaged objects in a comment.

Author(s)

Giorgio Arcara

Examples

1
2
3
4
5
data(ERPsets)
# compute the average of subjects 1 to 20 for the condition 
# specified by the string "Exp1_word_subj".
	
word=grandaverage("Exp1_word_subj", 1:20, erplist=ERPsets)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.