plotERParray: Plot ERP curves

Description Usage Arguments See Also Examples

View source: R/plots.R

Description

plotERParray is a generalization of matplot onto array inputs.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
plotERParray(
  dat,
  xdim = "time",
  sepdim = "chan",
  gfp_plot = if (sepdim == "chan") TRUE else FALSE,
  gfp_col = "black",
  gfp_lwd = 1.3,
  minus_up = if (gfp_plot) FALSE else TRUE,
  title = "",
  subtitle_col = "black",
  xlab = xdim,
  ylab = "amplitude",
  grid_dim = NULL,
  ...
)

Arguments

dat

a numeric array with named dimensions

xdim

character string; the name of the dimension of dat which defines the x axis (default: "time")

sepdim

character string; the name of the dimension of dat which separates the lines (default: "chan")

gfp_plot

logical value whether GFP curves should be also plotted (only if 'sepdim' is "chan")

gfp_col

the colour of the GFP curves (if plotted)

gfp_lwd

the thickness of the GFP curves (if plotted)

minus_up

logical value; if set to TRUE, minus values are plotted upwards. If FALSE, minus values are plotted downwards. By default, it is set to TRUE or FALSE depending on the 'gfp_plot' argument.

title

character string; the title of the plot

subtitle_col

colour(s) of the subtitles (recycled if necessary)

xlab

character string; the title of the x axis (defaults to the 'xdim' argument)

ylab

character string; the title of the y axis (default: "amplitude")

grid_dim

integer vector giving the number of rows and columns in which the plots are arranged; if set to NULL (default), the arrangement of the plot is set up automatically

...

additional parameters to be passed to matlines

See Also

matlines

Examples

1
2
3
4
5
6
7
8
# example data
data(erps)

# compute grand averages
plotdat <- avgDims(erps, "id")

# plot the channels in light grey, draw only solid lines
plotERParray(plotdat, col = "grey70", lty = 1)

tdeenes/eegR documentation built on April 19, 2021, 4:17 p.m.