erp.fun.loop {erpR} | R Documentation |
This functions allow to quickly perform loops over several objects with different base
or different time windows, to calculate an erp measure (i.e., erp.mean
, erp.peak
, or erp.latency
)
erp.fun.loop(bases=NULL, numbers=NULL, erp.fun=NULL, intervals=NULL, conditions.names=NULL, erplist=NULL, startmsec=NULL, endmsec=NULL, others=NULL, intervals.var=TRUE, ...)
bases |
a string indicating the beginning of the name of the object the ERP data (stored in an |
numbers |
the numbers (indicating the subjects) of the files to be imported. |
erp.fun |
the name of the function to be used (no quotes, e.g, |
intervals |
A list of pair of values, indicating the beginning and end of time windows on which to apply the |
conditions.names |
A vector of characters (same length of |
erplist |
If an erplist is specified, then the imported files will be added to this erplist. |
startmsec |
the start time (in ms) of the ERP data frames. It can be a negative value, indicating the baseline time frame. |
endmsec |
the end time (in ms) of the ERP data frames. |
others |
the names of other variables to be included in the returned data frame. Ignored if the format is "wide". |
intervals.var |
logical. Should a variable indicating intervals (with characters) should be included? |
... |
further arguments to be passed to the |
This function calculates an ERP measure on several ERP data frames, stored in a single erplist
. See the help for the used erp.fun
(i.e.,erp.mean
, erp.peak
, or erp.latency
) for further details.
An ERP data.frame
with the result of the call to the erp.fun
Giorgio Arcara
erp.mean
, erp.peak
, erp.latency
data(erplistExample) datall=erp.fun.loop(bases=c("Exp1_word_subj", "Exp1_nonword_subj"), numbers=1:20, erp.fun=erp.mean, conditions.names=c("word", "nonword"), erplist=erplistExample, intervals.var=TRUE, intervals=list(c(100, 200), c(300, 500)))