scalp.cor: plot the timepoint correlations between ERPs and an external...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/scalp.cor.R

Description

This function performs a series of correlations on each timepoint between ERP voltages and an external (typically a behavioural) variable. The set of ERP data frames is specified by base and numbers. The external variable is specified as a vector (of length equal to numbers) in the argument external. A scalp plot of the results is returned.

Usage

1
2
3
4
5
6
scalp.cor(base, numbers, external = NULL, alpha = 0.05, 
method = c("pearson", "kendall", "spearman"), sig = NULL, 
erplist = NULL, smo = NULL, layout = 1, ylims = "auto",
 yrev = TRUE, startmsec = -200, endmsec = 1200, lwd = c(1, 1), 
 lty = c(1, 1), col = "blue", legend = TRUE, legend.lab = "default",
 t.axis=seq(-100,endmsec,200), scalp.array=NULL)

Arguments

base

a string indicating the beginning of the name of the set of ERP data frames.

numbers

the numbers of the subjects of the set of ERP data frames .

external

a vector indicating the values of the external variable (typically a behavioural variable). This vector must be of the same length of numbers

alpha

the alpha of the correlation tests.

method

the method of the correlations.
Available methods are "pearson", "kendall", "spearman".

sig

if NULL, then a series of correlations is computed. If an appropriate object is specified (i.e. an object returned by scalp.cor or erp.cor) then the results are retrieved by this object and the function simply plots the results.

erplist

a list containing ERP data frames.

smo

the smoothing parameter to apply (see smooth.spline). Default is NULL and no smoothing is applied.

layout

A number indicating the layout of electrodes to be plotted. Currently only few default layouts are supported (a number from 1 to 5). Alternatively, a character vector specifying the layout may be supplied (see Details).

ylims

a number indicating the upper and lower limits of the y-axis. If "auto", the function calculates the y limits automatically.

yrev

logical. If TRUE, the y-axis is plotted with the negative values upward.

startmsec

the start time (in ms) of the ERP vector

endmsec

the end time (in ms) of the ERP vector

lwd

A vector specifying the line width to be associated with each ERP data frame specfied in categ

lty

A vector specifying the line types to be associated with each ERP data frame specfied in categ

col

the color of the ERP waveform.

legend

logical. If TRUE, a legend with object names is drawn in the top-right corner of the array.

legend.lab

the legend labels. If "default", the names are retrieved from the categ argument.

t.axis

the position of the ticks on an additional axis indicating the time. This axis is plotted in the bottom-left corner of the plot array.

scalp.array

This argument is vector of two values indicating the number of panels of the plot, as number of rows and number of columns respectively. If a default layout is specified, the number of panels is automatically computed. See also Details.

Details

The layout parameter can be a number (from 1 to 5), that specifies some default electrode arrangements (currently only a few default arrangements are supported). Otherwise, the argument may be a character vector indicating the names of the electrodes to be plotted. The plot is divided in a number of panels as specified in scalp.array. The names specified will be plotted from top to bottom and from left to right. If "blank" is specified an empty panel will be plotted. If "xaxis" is specified a x axis indicating time will be plotted. If "yaxis" is specified a y axis indicating voltage will be plotted.

Value

The function plots a scalp map of ERP waveforms in an array resembling the topographic locations of the electrodes on the scalp. The waveforms represent an average of the first set of specified data frames. Timepoints with a positive (and significant) correlation are highlighted by red bars. Timepoints with a negative (and significant) correlation are highlighted by blue bars. The function also returns an object with the results of the correlations. This object can be used for future plots with erp.cor or scalp.cor, by specifying it as the argument sig.

Author(s)

Giorgio Arcara

See Also

erp.cor, ~~~

Examples

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

#generate an hypothetic external variables
RT=rnorm(20, mean=500, sd=200)

scalp.cor("Exp1_word_subj", 1:20, external = RT, layout=1, 
erplist=ERPsets, ylim=10, legend=TRUE)

## End(Not run)

erpR documentation built on May 31, 2017, 5:01 a.m.