Plots Multi-Channel EEG Time Course

Share:

Description

Creates plot of multi-channel electroencephalography (EEG) time courses with subplots positioned according to electrode locations. User can control the plot orientation, line types, line colors, etc.

Usage

1
2
eegtimemc(time,voltmat,channel,size=c(0.75,0.75),
          vadj=0.5,hadj=0.5,xlab="",ylab="",voltSE=NULL,...)

Arguments

time

Vector of time points at which EEG was recorded.

voltmat

Matrix of multi-channel EEG voltages (time by channel).

channel

Character vector giving name of channel for each column of voltmat.

size

Relative size of each subplot.

vadj

Vertical adjustment for each subplot.

hadj

Horizontal adjustment for each subplot.

xlab

X-axis label for each subplot.

ylab

Y-axis label for each subplot.

voltSE

Matrix of voltage standard errors (same size as voltmat).

...

Optional inputs for eegtime function.

Value

Produces plot of EEG time course with NULL return value.

Note

Currently supports 84 scalp electrodes (plus ears and nose): A1 A2 AF1 AF2 AF3 AF4 AF5 AF6 AF7 AF8 AFZ C1 C2 C3 C4 C5 C6 CP1 CP2 CP3 CP4 CP5 CP6 CPZ CZ F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 FC1 FC2 FC3 FC4 FC5 FC6 FCZ FP1 FP2 FPZ FT7 FT8 FT9 FT10 FZ I1 I2 IZ NZ O1 O2 OZ P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 POZ PZ T7 T8 T9 T10 TP7 TP8 TP9 TP10

Subplots are created using eegtime, so input ... can be any optional input for eegtime.

Inspired by Frank Harrell's subplot function (in Hmisc package).

Author(s)

Nathaniel E. Helwig <helwig@umn.edu>

References

Bache, K. & Lichman, M. (2013). UCI Machine Learning Repository [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School of Information and Computer Science.

Begleiter, H. Neurodynamics Laboratory. State University of New York Health Center at Brooklyn. http://www.downstate.edu/hbnl/

Harrell, F., Dupont, C., and Others. Hmisc: Harrell Miscellaneous. http://CRAN.R-project.org/package=Hmisc

Ingber, L. (1997). Statistical mechanics of neocortical interactions: Canonical momenta indicatros of electroencephalography. Physical Review E, 55, 4578-4593.

Ingber, L. (1998). Statistical mechanics of neocortical interactions: Training and testing canonical momenta indicators of EEG. Mathematical Computer Modelling, 27, 33-64.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
##########   EXAMPLE   ##########

# # get control ("c") data from "eegdata" data
# data(eegdata)
# idx <- which(eegdata$group=="c")
# eegdata <- eegdata[idx,]

# # get average 
# eegmean <- tapply(eegdata$voltage,list(eegdata$time,eegdata$channel),mean)
# eegse <- tapply(eegdata$voltage,list(eegdata$time,eegdata$channel),sd)/sqrt(50)

# # plot time course for all electrodes
# quartz(height=15,width=15)
# tseq <- seq(0,1000,length.out=256)
# eegtimemc(tseq,eegmean,colnames(eegmean),ylim=c(-11,14),voltSE=eegse)