Description Usage Arguments Details Value Note Author(s) See Also Examples
This utility function of the erpR
package converts an ERP data frame with a single variable in wide format to a long format.
1 |
deps |
the numbers of the columns in the specified data frame to be rearranged from wide format to long format. |
oth |
other variables that are to be kept in the returned data frame. |
dataset |
the name of the data frame to be converted from wide format to long format. |
name.dep |
the name of the dependent variable in the returned data frame. |
name.newvar |
the name of the variable indicating the levels associated with |
The function converts a dataframe with a single variable in wide format (levels are in separate columns) in a data frame in long format (the variable is in a single column and the levels are specified by other columns). The original variable in wide format is represented in two columns: one (labeled by name.dep
parameter) indicating the values of the dependent variable, and the other that is a factor (labeled by name.newvar
parameter) indicating the levels of the variable for each observation. The variables specified in oth
are replicated appropriately. This function is called internally by erp.mean
, erp.peak
, and erp.latency
.
A data frame in which the variables specified in the columns deps
are converted in a single column name.dep
with levels specified in name.newvar
This function is called internally by erp.mean
, erp.peak
, and erp.latency
.
Giorgio Arcara
erp.mean
, erp.peak
, erp.latency
1 2 3 4 5 6 | data(erplistExample)
datwide=erp.mean(base="Exp1_word_subj", numbers=1:20, win.ini=130,
win.end=190, erplist=erplistExample, startmsec=-200, endmsec=1500, format="wide")
dat.long=rearrange(deps=c(1:32), oth=35:36, dataset=datwide, name.newvar="electrode")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.