## A dummy example with 5 electrodes and 20 time points
data <- matrix(rnorm(100), nrow = 5)
## create an Epoch object
epoch <- Epoch(data)
windowNum <- 10
step <- 5
lambda <- 0.1
calcAdjFrag(
epoch = epoch, window = windowNum,
step = step, lambda = lambda, progress = TRUE
)
## A more realistic example with parallel computing
# \donttest{
if (requireNamespace("doSNOW")) {
## Register a SNOW backend with 4 workers
library(parallel)
library(doSNOW)
cl <- makeCluster(4, type = "SOCK")
registerDoSNOW(cl)
data("pt01EcoG")
epoch <- Epoch(pt01EcoG)
window <- 250
step <- 125
title <- "PT01 seizure 1"
calcAdjFrag(
epoch = epoch, window = window,
step = step, parallel = TRUE, progress = TRUE
)
## stop the parallel backend
stopCluster(cl)
}
# }
Run the code above in your browser using DataLab