Commit 49fbef84 authored by de Lavenne Alban's avatar de Lavenne Alban
Browse files

fix: set number of threads when parallelising rsimilarity

No related merge requests found
Showing with 2 additions and 5 deletions
+2 -5
...@@ -31,11 +31,8 @@ rsimilarity <- function(Rn, FUN="invRMSE", parallel=FALSE, cores=NULL){ ...@@ -31,11 +31,8 @@ rsimilarity <- function(Rn, FUN="invRMSE", parallel=FALSE, cores=NULL){
if(ncol(Rn) < 2) stop("Rn should have at least two columns") if(ncol(Rn) < 2) stop("Rn should have at least two columns")
# Parallelisation # Parallelisation
if(parallel & (missing(cores)|is.null(cores))){ if(parallel & (missing(cores)|is.null(cores))) cores <- parallel::detectCores()
cores <- parallel::detectCores() if(!parallel) cores <- 1
}else{
cores <- 1
}
# Initialise msim # Initialise msim
n <- ncol(Rn) n <- ncol(Rn)
......
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