plotwindows(data, classes.Id, rec.Id, which.classes = "ALL",
which.rec = "ALL", which.channels = "ALL", win = 10, stat = "sum",
power = 2, abs = FALSE, log = FALSE, complete = FALSE, mintomax = FALSE)classes.Id and rec.Id should be given and must have length equal to the number of rows in the data frame.
data. Thus each value in the array identifies the class ID of each signal in each row of the database. For example, let classes.Id = c(rep(1,5),rep(2,5)), this means that the first 5 rows of data represents the class with ID 1 and the lines 6 to 10 represent the class with ID 2.
data. Thus each value in the array identifies the recording ID of each signal in each row of the database. For example, let rec.Id <- c(rep(1,5),rep(2,5)), this means that the first 5 rows of data represents the recording with ID 1 of some class and the lines 6 to 10 represent the recording with ID 2 of some class. rec.Id must be numeric and numerated from 1 to the total number of recordings for each class.
which.classes= c(1,3) then the classes with ID 1 and 3 will be plotted (indicated by the vector classes.Id). If which.classes= "ALL" then all classes will be plotted. Obs: if type = "T.pvalue" then only two classes are allowed.
which.rec= list(c(1,3,4),c(1,2,4)) then the recordings with ID 1,3 and 4 will be plotted for the first class indicated in the vector which.classes and the recordings with ID 1,2 and 4 will be plotted for the second class indicated in the vector which.classes. If which.rec="ALL" then all recordings will be plotted.
which.channels =c(1,3) then the channels 1 and 3 (columns 1 and 3 of data) will be plotted. If which.channels ="ALL" then all channels will be plotted.
stat= "sum" then the sum is used. If stat="mean" then the mean is used. If stat="var" then the variance is used. If stat="sd" then the standard deviation is used. If stat="max" then the maximum value is used. If stat="min" then the minimum value is used. If stat="prod" then the product is used. If stat= "median" then the median is used. If stat="geometric" then the geometric mean is used. If stat="harmonic" then the harmonic mean is used.
data^power. OBS: watch out for negative values if power is not an integer!
abs=TRUE, then the transformation will be abs(data)^power.
log=TRUE and abs=TRUE, then the transformation will be log(abs(data) ^power+1). OBS: watch out for negative values if abs= FALSE
complete=FALSE, then the windows will be completely separated. For example, if win=10 then the first window will consist of signals 1 to 10, the second window will consist of signals 11 to 20, and so on. If complete=TRUE, then some signals will overlap in consecutive windows. For example, if win=10 then the first window will consist of observations 1 to 10, the second window will consist of observations 2 to 11, the third will consist of observations 3 to 12, and so on.
mintomax=FALSE then the function will plot each obtained value for each window in order. If mintomax=TRUE then the function will sort the obtained values for each window and then plot these values from minimum to maximum, and thus, providing a quantile analysis.
data.classes.Id but related to the output parameter data.rec.Id but related to the output parameter data.plotEEG
library(eegAnalysis)
### Simulating a data set
sim<-randEEG()
### Plotting the sum of the signals in windows of size 10
plotwindows(sim$data, sim$classes.Id , sim$rec.Id , which.classes = "ALL", which.rec="ALL",
which.channels=c(1), win=10, stat="sum", power = 2, abs=FALSE,
log=FALSE,complete = FALSE, mintomax=FALSE)
### Plotting the sorted sum of the signals in windows of size 10
plotwindows(sim$data, sim$classes.Id , sim$rec.Id , which.classes = "ALL", which.rec="ALL",
which.channels=c(1), win=10, stat="sum", power = 2, abs=FALSE,
log=FALSE,complete = FALSE, mintomax=TRUE)
Run the code above in your browser using DataLab