erp: plot an ERP waveform

Description Usage Arguments Value Author(s) See Also Examples

Description

A function to plot an ERP waveform of a single electrode. If used with default values the function allows a fast plotting. Several parameters are available for plotting paper quality plots.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
erp(erpdf, electrode, startmsec=NULL, endmsec = NULL, smo = NULL, 
interval = c(startmsec, endmsec),xlim = NULL, ylim = NULL,
col = "black",  lwd = 1, xlab = "", ylab = "", 
main = "", frame.plot = TRUE, draw.xaxis = TRUE, draw.yaxis = TRUE, type = "l", 
x0 = TRUE, x.tick = NULL, x.labels=x.tick, x.las=0, x.pos = NA,  x.outer = F, 
x.font = NA,  x.lty = "solid", x.lwd = 1, x.lwd.ticks = 1,  x.col = NULL,  
x.col.ticks = NULL,  x.hadj = NA, x.padj = NA, x.tcl = -0.5,  x.tick.both= FALSE,
x.cex = 1, y.tick = NULL,  y.labels = y.tick, y.las=0, y.pos = NA, y.outer = F, 
y.font = NA, y.lty = "solid", y.lwd = 1,  y.lwd.ticks = 1, y.col = NULL, 
y.col.ticks = NULL, y.hadj = NA, y.padj = NA,  y.tcl = -0.5, y.tick.both= FALSE,
y.cex = 1, ...)

Arguments

erpdf

a data.frame with timepoints in row and electrodes in columns.

electrode

character indicating the electrode to plot.

startmsec

the start time (in ms) of the erpdf.

endmsec

the end time (in ms) of the erpdf.

smo

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

interval

a vector with a pair of values indicating the interval (in milliseconds) to be plotted.

xlim

a vector with a pair of values indicating the limits (in milliseconds) of the x axis. Default is NULL and the xlim is automatically computed.

ylim

a vector with a pair of values indicating the limits (in milliseconds) of the y axis.Default is NULL and the ylim is automatically computed.

col

the color of the ERP waveform.

lwd

the line width of the ERP waveform.

xlab

the label of the x axis.

ylab

the label of the y axis.

main

the title of the plot.

frame.plot

a logical indicating whether a box should be drawn around the plot.

draw.xaxis

a logical indicating whether the x axis should be drawn.

draw.yaxis

a logical indicating whether a box should be drawn around the plot.

type

1-character string giving the type of plot desired. Default is "l" and a line will be plotted. If "n" the ERP waveform is not plotted (see plot.default).

x0

a logical indicating whether a short segment should be drawn to indicate the 0 point (in millisecond)

x.tick

the position (in milliseconds) of x ticks. Default is NULL and the ticks are automatically determined.

x.labels

the labels (usually a vector of numbers) to be plotted on the x axis.

y.las

the style of y axis labels.

x.las

the style of x axis labels.

x.pos

the position of x axis, in terms of y axis coordinates. Default is NA and the axis is drawn at the bottom of the plot.

x.outer

a logical value indicating whether the x axis should be drawn in the outer plot margin, rather than the standard plot margin.

x.font

font for text of x labels. Defaults to par("font").

x.lty

line type for both the x axis line and the x tick marks.

x.lwd

line width for the x axis line.

x.lwd.ticks

line width for the x tick marks.

x.col

colors for the x axis line and the x tick marks.

x.col.ticks

color for the x tick marks (if specified, override x.col)

x.hadj

adjustment (see par("adj")) for all x labels parallel ("horizontal") to the reading direction. If this is not a finite value, the default is used (centring for strings parallel to the axis, justification of the end nearest the axis otherwise).

x.padj

adjustment for each x tick label perpendicular to the reading direction. For labels parallel to the axes, padj = 0 means right or top alignment, and padj = 1 means left or bottom alignment. This can be a vector given a value for each string, and will be recycled as necessary.

x.tcl

The length of tick marks as a fraction of the height of a line of text. The default value is -0.5.

x.tick.both

Logical. Should the tick marks be drawn both above and below the x axis?

x.cex

The magnification to be used for the x labels.

y.tick

the position (in milliseconds) of y ticks. Default is NULL and the ticks are automatically determined.

y.labels

the labels (usually a vector of numbers) to be plotted on the y axis.

y.pos

the position of y axis, in terms of x axis coordinates. Default is NA and the axis is drawn at the left of the plot.

y.outer

a logical value indicating whether the y axis should be drawn in the outer plot margin, rather than the standard plot margin.

y.font

font for teyt of y labels. Defaults to par("font").

y.lty

line type for both the y axis line and the y tick marks.

y.lwd

line width for the y axis line.

y.lwd.ticks

line width for the y tick marks.

y.col

colors for the y axis line and the y tick marks.

y.col.ticks

color for the y tick marks (if specified, override y.col)

y.hadj

adjustment (see par("adj")) for all y labels parallel ("horizontal") to the reading direction. If this is not a finite value, the default is used (centring for strings parallel to the axis, justification of the end nearest the axis otherwise).

y.padj

adjustment for each y tick label perpendicular to the reading direction. For labels parallel to the ayes, padj = 0 means right or top alignment, and padj = 1 means left or bottom alignment. This can be a vector given a value for each string, and will be recycled as necessary.

y.tcl

The length of tick marks as a fraction of the height of a line of teyt. The default value is -0.5.

y.tick.both

Logical. Should the tick marks be drawn both above and below the y axis?

y.cex

The magnification to be used for the y labels.

...

further parameters to be passed to plot.

Value

the plot of an ERP waveform.

Author(s)

Giorgio Arcara

See Also

erp.t, erp.infl, erp.cor, erp.xaxis, erp.yaxis

Examples

1
2
3
4
5
data(erplistExample)

word=grandaverage("Exp1_word_subj", 1:20, erplist=erplistExample) 

erp(word, "F3", smo=0, col="blue",  ylim=c(-6,6))

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