Description Usage Arguments Methods (by class) Notes on usage of Generalized Additive Models for interpolation Author(s) Examples
Allows topographical plotting of functional data. Output is a ggplot2 object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | topoplot(data, ...)
## Default S3 method:
topoplot(data, ...)
## S3 method for class 'data.frame'
topoplot(
data,
time_lim = NULL,
limits = NULL,
chanLocs = NULL,
method = "Biharmonic",
r = NULL,
grid_res = 200,
palette = "RdBu",
interp_limit = "skirt",
contour = TRUE,
chan_marker = "point",
quantity = "amplitude",
montage = NULL,
colourmap,
highlights = NULL,
scaling = 1,
groups = NULL,
verbose = TRUE,
...
)
## S3 method for class 'eeg_data'
topoplot(
data,
time_lim = NULL,
limits = NULL,
chanLocs = NULL,
method = "Biharmonic",
r = NULL,
grid_res = 200,
palette = "RdBu",
interp_limit = "skirt",
contour = TRUE,
chan_marker = "point",
quantity = "amplitude",
montage = NULL,
highlights = NULL,
scaling = 1,
verbose = TRUE,
...
)
## S3 method for class 'eeg_epochs'
topoplot(
data,
time_lim = NULL,
limits = NULL,
chanLocs = NULL,
method = "Biharmonic",
r = NULL,
grid_res = 200,
palette = "RdBu",
interp_limit = "skirt",
contour = TRUE,
chan_marker = "point",
quantity = "amplitude",
montage = NULL,
highlights = NULL,
scaling = 1,
groups = NULL,
verbose = TRUE,
...
)
## S3 method for class 'eeg_ICA'
topoplot(
data,
component,
time_lim = NULL,
limits = NULL,
chanLocs = NULL,
method = "Biharmonic",
r = NULL,
grid_res = 200,
palette = "RdBu",
interp_limit = "skirt",
contour = TRUE,
chan_marker = "point",
quantity = "amplitude",
montage = NULL,
colourmap,
highlights = NULL,
scaling = 1,
verbose = TRUE,
...
)
## S3 method for class 'eeg_tfr'
topoplot(
data,
time_lim = NULL,
limits = NULL,
chanLocs = NULL,
method = "Biharmonic",
r = NULL,
grid_res = 200,
palette = "RdBu",
interp_limit = "skirt",
contour = TRUE,
chan_marker = "point",
quantity = "power",
montage = NULL,
highlights = NULL,
scaling = 1,
freq_range = NULL,
verbose = TRUE,
...
)
|
data |
An EEG dataset. If the input is a data.frame, then it must have columns x, y, and amplitude at present. x and y are (Cartesian) electrode co-ordinates), amplitude is amplitude. |
... |
Various arguments passed to specific functions |
time_lim |
Timepoint(s) to plot. Can be one time or a range to average over. If none is supplied, the function will average across all timepoints in the supplied data. |
limits |
Limits of the fill scale - should be given as a character vector with two values specifying the start and endpoints e.g. limits = c(-2,-2). Will ignore anything else. Defaults to the range of the data. |
chanLocs |
Allows passing of channel locations (see
|
method |
Interpolation method. "Biharmonic" or "gam". "Biharmonic" implements the same method used in Matlab's EEGLAB. "gam" fits a Generalized Additive Model with k = 40 knots. Defaults to biharmonic spline interpolation. |
r |
Radius of cartoon head_shape; if not given, defaults to 1.1 * the maximum y electrode location. |
grid_res |
Resolution of the interpolated grid. Higher = smoother but slower. |
palette |
Defaults to RdBu if none supplied. Can be any from RColorBrewer or viridis. If an unsupported palette is specified, switches to Greens. |
interp_limit |
"skirt" or "head". Defaults to "skirt". "skirt" interpolates just past the farthest electrode and does not respect the boundary of the head_shape. "head" interpolates up to the radius of the plotted head. |
contour |
Plot contour lines on topography (defaults to TRUE) |
chan_marker |
Set marker for electrode locations. "point" = point, "name" = electrode name, "none" = no marker. Defaults to "point". |
quantity |
Allows plotting of arbitrary quantitative column. Defaults to amplitude. Use quoted column names. E.g. "p.value", "t_statistic". |
montage |
Name of an existing montage set. Defaults to NULL; (currently only 'biosemi64alpha' available other than default 10/20 system) |
colourmap |
Deprecated, use palette instead. |
highlights |
Electrodes to highlight (in white). |
scaling |
Scaling multiplication factor for labels and any plot lines. Defaults to 1. |
groups |
Column name for groups to retain. |
verbose |
Warning messages when electrodes do not have locations. Defaults to TRUE. |
component |
Component to plot (numeric) |
freq_range |
Range of frequencies to average over. |
default
: Default method for data frames.
data.frame
: Topographical plotting of data.frames and other non
eeg_data objects.
eeg_data
: Topographical plotting of eeg_data
objects.
eeg_epochs
: Topographical plotting of eeg_epochs
objects.
eeg_ICA
: Topographical plot for eeg_ICA
objects
eeg_tfr
: Topographical plotting of eeg_tfr
objects.
The function fits a GAM using the gam function from mgcv. Specifically, it fits a spline using the model function gam(z ~ s(x, y, bs = "ts", k = 40). Using GAMs for smooths is very much experimental. The surface is produced from the predictions of the GAM model fitted to the supplied data. Values at each electrode do not necessarily match actual values in the data: high-frequency variation will tend to be smoothed out. Thus, the method should be used with caution.
Matt Craddock, matt@mattcraddock.com
1 2 | topoplot(demo_epochs)
topoplot(demo_epochs, time_lim = c(.1, .2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.