erplist.resample: Resample ERP data frames in an erplist.

Description Usage Arguments Details Value Note Author(s) Examples

Description

This function resample all the data of several ERP data frames, stored in a erplist. It relies on the signal package.

Usage

1
2
erplist.resample(base=NULL, numbers=NULL, erplist=NULL, 
outname=paste(base, "_res", sep=""), sr.factor=c(1,2))

Arguments

base

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

numbers

the numbers of the subjects to be averaged by the function.

erplist

a list containing the ERP data frames specified in base and numbers.

outname

the base of the name of the resulting ERP data.frames (that will result from the combination of this base and numbers)

sr.factor

A vector of two values, determining the ratio of the resulting resampling. For example the default c(1,2), halves the sampling rate. A value of c(1,4) will change the sampling rate to 1/4 of the original and so on.

Details

The function takes an erplist containing ERP data.frame as input, in the style of erpR and use the resample function from the signal pacakge to perform resampling.

Value

A new erplist with the data resampled.

Note

This function rely on the resample function from signal package. Note that you have to install separately the signal package.

Author(s)

Giorgio Arcara

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
data(erplistExample)

erplist_res=erplist.resample(base="Exp1_word_subj", numbers=1:20, 
erplist=erplistExample, sr.factor=c(1,2))

# original data were sampled at 500 Hz, data in erplist_res are sampled at 250 Hz. 

## End(Not run)

erpR documentation built on June 7, 2019, 3 a.m.