WSL/SLF GitLab Repository

Commit 59df069e authored by Adrien Michel's avatar Adrien Michel
Browse files

Removed old R implementation

parent 6a228598
......@@ -4,7 +4,7 @@
#' @param ... A
#' @export
compute.spatial.pools <- function(data, params.qm, ncores = 1,
output.file=NULL, type = "R") {
output.file=NULL) {
if(params.qm$target < 0) {
stop(paste0("params.qm$target must be > 0'"))
}
......
......@@ -38,22 +38,12 @@ compute.temporal.pools <- function(data, params.qm, ncores=1, output.file=NULL)
timestamps <- data$time.date
if(ncores>1) {
`%dopar%` <- foreach::`%dopar%`
doParallel::registerDoParallel(ncores)
temporal.pools <- foreach::foreach(time=c(1:366)) %dopar% {
compute.temporal.pools.internal(timestamps, time,
params.qm$temporal.pool)
}
doParallel::stopImplicitCluster()
}
else {
`%do%` <- foreach::`%do%`
temporal.pools <- foreach::foreach(time=c(1:366)) %do% {
compute.temporal.pools.internal(timestamps, time,
params.qm$temporal.pool)
}
`%do%` <- foreach::`%do%`
temporal.pools <- foreach::foreach(time=c(1:366)) %do% {
compute.temporal.pools.internal(timestamps, time,
params.qm$temporal.pool)
}
if(!is.null(output.file)) {
saveRDS(temporal.pools,paste0(output.file))
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment