import.erp: import ERP data matrices from ASCII files (file extension...

Description Usage Arguments Details Value Author(s) Examples

Description

Import a series of ASCII files with ERP data. Data are imported as a list containing a data frame for each imported file. The field separator character and the character used for decimal points may be specified by the parameters sep and dec, that are passed to the function read.table, called by import.erp.

Usage

1
2
3
import.erp(filenamebase, numbers, ext=".txt", 
outname = "ERP_subj", fileinfo=FALSE, abstimeinfo=FALSE, erplist = NULL, path=getwd(), 
electrodes="file", startmsec=NULL, endmsec=NULL, values.multi=1, ...)

Arguments

filenamebase

a string indicating the beginning of the name of the .txt files containing the ERP data.

numbers

the numbers (indicating the subjects) of the files to be imported.

ext

A string indicating file extension. Default is ".txt"

outname

a string indicating the beginning of the name of the objects that will be created.

fileinfo

If TRUE the function expects that in the first row of imported file there is a string indicating some information on the subject to be stored as a comment in the data frame created.

abstimeinfo

If TRUE the function expects that in the first row of imported file there is a string indicating the absolute trial time in the recording. This is can be crucial to reconstruct the correct order of trials for single-trial analysis.

erplist

If an erplist is specified, then the imported files will be added to this erplist.

path

A string indicating the directory where the ASCII files are contained. Otherwise the files will be searched from the current working directory.

electrodes

if "file" (the default), electrode names are retrieved from the imported file, as header. Otherwise a vector with electrode names can be specified.

startmsec

the start time (in ms) of the ERP data frames. It can be a negative value, indicating the baseline time frame.This info will be stored in the imported object as an attribute of the data.frame.

endmsec

the end time (in ms) of the ERP data frames. This info will be stored in the imported object as an attribute of the data.frame.

values.multi

A multiplication factor to be applied to all numeric values while importing. Default is 1 (i.e., no correction).

...

further parameters to be passed to read.table.

Details

The optional argument fileinfo can be used to store some short information on the file. This is usually an ID for the Subject or the name of the original file from which the ASCII file has been exported (for example, if the files have been exported from eeglab, the name of the .set file). All objects that will be created from a file imported with import.erp will keep this information as a comment. Type comment(objectname) to access this information. If fileinfo=FALSE, the name of the file imported will be stored as a comment. The timeinfo option expects that absoulte time of trial (in the recording session), is stored after the string Time = (note the spacing).

Value

A list containing several ERP data frames (one for each file imported).

Author(s)

Giorgio Arcara

Examples

1
2
3
4
5
6
7
8
## Not run: 
### The following is an example for importing a series of file
## named Exp1_word_subj1.txt, Exp1_word_subj2.txt, etc.

#Exp1 <- import.erp(filenamebase="Exp1_word_subj", numbers=1:20, 
#	outname="Exp1_word_subj", ext=".txt" fileinfo = T, erplist=NULL)

## End(Not run)

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