Description Usage Arguments Details Value Author(s) Examples
dif.wave
calculates a difference waveform from two data frames in the format
returned from load.data
1 |
x |
A data frame in the format returned from |
z |
A data frame in the format returned from |
name |
Specify the Stimulus column name of the difference data frame. Must provide the new name in quotations. |
keep |
Include one of the data frames used in subtraction in the returned difference data frame.
By default |
The data frames must either:
have been imported using load.data
- OR -
for subset data, the "Stimulus" column must be "refactored." See the example below for one way to "reset" the factors in the "Stimulus" column. Note this procedure is only necessary for subset data, and not data frames that were independently imported.
One of two possible data frames, depending on the value of keep
:
keep
= "y": the difference (i.e., x - z) data frame
and the minuend data frame (i.e., x)
keep
= "n": just the difference data frame
Travis Moore
1 2 3 4 5 6 7 8 9 10 | # Calculate a difference wave
Negative = ERPdata[1:6765, ]
Neutral = ERPdata[6766:13530, ]
refactor.neg <- factor(Negative$Stimulus)
refactor.neut <- factor(Neutral$Stimulus)
Negative$Stimulus <- refactor.neg
Neutral$Stimulus <- refactor.neut
difference <- dif.wave(Negative, Neutral, name = "Neg - Neut", keep = Neutral)
head(difference) # view the new Stimulus column name
grandaverage(difference, "V78") # plot the grand average difference wave
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.