complexplot2dview: Plot topography in complex layout

Description Usage Arguments See Also Examples

View source: R/plots.R

Description

complexplot2dview plots the scalp topographies of different groups or conditions by calling plot2dview on a list of vectors or matrices

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
complexplot2dview(
  dat,
  ch_pos,
  timepoint,
  datgrid = NULL,
  layout_matrix = NULL,
  heights = NULL,
  widths = NULL,
  title_row = NULL,
  title_col = NULL,
  title_map = NULL,
  title_main = paste("Time:", paste(timepoint, collapse = ", "), "ms"),
  plot_bar = TRUE,
  ampl_range = NULL,
  gfp = NULL,
  ...
)

Arguments

dat

a list of numeric vectors or matrices, which can be plotted by plot2dview

ch_pos

a data.frame of electrode positions, see coordinates

timepoint

integer; the timepoint at which the scalp distributions are compared. Can be a vector referring to the timepoints of each topomap.

datgrid

arrangement of the grid (number of rows X columns)

layout_matrix, heights, widths

arguments to be passed to layout. If given, it overrides datgrid. Note that the layout matrix refers to the whole plot, including the main title, the column titles, the row titles, the scalp plots, and the colourbar plot (in this order).

title_row, title_col

character vectors of the titles of rows and columns, respectively. If NULL and dat has dimnames attribute, rownames(dat) and colnames(dat) are used.

title_map

character vector; the titles of the individual scalp maps. if NULL and dat has names attribute, names(dat) is used.

title_main

character; the title of the plot (default: the timepoint(s))

plot_bar

logical; should a colour bar be plotted below the maps (default: TRUE)

ampl_range

numeric vector of the amplitude range. If not provided, the range is computed from the input data.

gfp

a list of Global Field Power data along the whole epoch

...

additional arguments to be passed to plot2dview

See Also

plot2dview

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# example dataset
data(erps)
chan_pos <- attr(erps, "chan")   # channel positions

# plot the grand average scalp distribution at 180 ms, for each stimulus 
# class and pairtye condition; display also the GFP curves of the 
# whole epochs
timepoint <- 180
plotdat <- splitArray(avgDims(erps, "id"), 
                      c("stimclass", "pairtype"), 
                      drop = TRUE)
gfpdat <- lapply(plotdat, compGfp)
plotdat[] <- lapply(plotdat, subsetArray,
                    list(time = as.character(timepoint)))
complexplot2dview(plotdat,
                  chan_pos, timepoint, 
                  gfp = gfpdat, plot_ch = FALSE)

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