Skip to content

Commit

Permalink
Fix do.full.models
Browse files Browse the repository at this point in the history
Disabled do.full.models if calib.lines not complete
  • Loading branch information
HeleneBlt committed Apr 26, 2024
1 parent d41fbd2 commit 28c2f29
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions R/BIOMOD_Modeling.R
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@ BIOMOD_Modeling <- function(bm.format,
modeling.id = modeling.id,
models = models,
models.pa = models.pa,
OPT.user = OPT.user,
OPT.user = OPT.user,
CV.user.table = CV.user.table,
CV.do.full.models = CV.do.full.models,
weights = weights,
prevalence = prevalence,
metric.eval = metric.eval,
Expand Down Expand Up @@ -573,6 +575,7 @@ BIOMOD_Modeling <- function(bm.format,
# ---------------------------------------------------------------------------- #

.BIOMOD_Modeling.check.args <- function(bm.format, modeling.id, models, models.pa, OPT.user
, CV.user.table, CV.do.full.models
, weights, prevalence, metric.eval, var.import
, scale.models, nb.cpu, seed.val, do.progress)
{
Expand Down Expand Up @@ -659,6 +662,14 @@ BIOMOD_Modeling <- function(bm.format,
# bm.options <- BIOMOD_ModelingOptions()
# }

## 4. Check user
if (!is.null(CV.user.table)){
if(!("_allData_allRun" %in% colnames(CV.user.table)) & CV.do.full.models == T){
CV.do.full.models = FALSE
warning("CV.do.full.model has been disabled because '_allData_allRun' is not provided in CV.user.table")
}
}

## 5. Check prevalence arguments --------------------------------------------
if (!is.null(prevalence)) {
.fun_testIf01(TRUE, "prevalence", prevalence)
Expand Down Expand Up @@ -740,7 +751,8 @@ BIOMOD_Modeling <- function(bm.format,
metric.eval = metric.eval,
prevalence = prevalence,
seed.val = seed.val,
do.progress = do.progress))
do.progress = do.progress,
CV.do.full.models = CV.do.full.models))
}


Expand Down

0 comments on commit 28c2f29

Please sign in to comment.