Running examples in ‘biomod2-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: BIOMOD_EnsembleModeling
> ### Title: Create and evaluate an ensemble set of models and predictions
> ### Aliases: BIOMOD_EnsembleModeling
> ### Keywords: ensemble models weights
> 
> ### ** Examples
> 
> 
> library(terra)
terra 1.7.39
> # Load species occurrences (6 species available)
> data(DataSpecies)
> head(DataSpecies)
  X_WGS84  Y_WGS84 ConnochaetesGnou GuloGulo PantheraOnca PteropusGiganteus
1   -94.5 82.00001                0        0            0                 0
2   -91.5 82.00001                0        1            0                 0
3   -88.5 82.00001                0        1            0                 0
4   -85.5 82.00001                0        1            0                 0
5   -82.5 82.00001                0        1            0                 0
6   -79.5 82.00001                0        1            0                 0
  TenrecEcaudatus VulpesVulpes
1               0            0
2               0            0
3               0            0
4               0            0
5               0            0
6               0            0
> 
> # Select the name of the studied species
> myRespName <- 'GuloGulo'
> 
> # Get corresponding presence/absence data
> myResp <- as.numeric(DataSpecies[, myRespName])
> 
> # Get corresponding XY coordinates
> myRespXY <- DataSpecies[, c('X_WGS84', 'Y_WGS84')]
> 
> # Load environmental variables extracted from BIOCLIM (bio_3, bio_4, bio_7, bio_11 & bio_12)
> data(bioclim_current)
> myExpl <- terra::rast(bioclim_current)
> 
> ## Don't show: 
> myExtent <- terra::ext(0,30,45,70)
> myExpl <- terra::crop(myExpl, myExtent)
> ## End(Don't show)
> 
> ## ----------------------------------------------------------------------- #
> file.out <- paste0(myRespName, "/", myRespName, ".AllModels.models.out")
> if (file.exists(file.out)) {
+   myBiomodModelOut <- get(load(file.out))
+ } else {
+ 
+   # Format Data with true absences
+   myBiomodData <- BIOMOD_FormatingData(resp.var = myResp,
+                                        expl.var = myExpl,
+                                        resp.xy = myRespXY,
+                                        resp.name = myRespName)
+ 
+   # Create default modeling options
+   myBiomodOptions <- BIOMOD_ModelingOptions()
+ 
+   # Model single models
+   myBiomodModelOut <- BIOMOD_Modeling(bm.format = myBiomodData,
+                                       modeling.id = 'AllModels',
+                                       models = c('RF', 'GLM'),
+                                       bm.options = myBiomodOptions,
+                                       CV.strategy = 'random',
+                                       CV.nb.rep = 2,
+                                       CV.perc = 0.8,
+                                       metric.eval = c('TSS','ROC'),
+                                       var.import = 3,
+                                       seed.val = 42)
+ }
> 
> ## ----------------------------------------------------------------------- #
> # Model ensemble models
> myBiomodEM <- BIOMOD_EnsembleModeling(bm.mod = myBiomodModelOut,
+                                       models.chosen = 'all',
+                                       em.by = 'all',
+                                       em.algo = c('EMmean', 'EMca'),
+                                       metric.select = c('TSS'),
+                                       metric.select.thresh = c(0.7),
+                                       metric.eval = c('TSS', 'ROC'),
+                                       var.import = 3,
+                                       seed.val = 42)

-=-=-=-=-=-=-=-=-=-=-=-=-=-= Build Ensemble Models -=-=-=-=-=-=-=-=-=-=-=-=-=-=

   ! all models available will be included in ensemble.modeling
  ! Ensemble Models will be filtered and/or weighted using validation dataset (if possible). Please use `metric.select.dataset` for alternative options.
   > Evaluation & Weighting methods summary :
      TSS over 0.7


     !! Ensemble Model mergedData_mergedRun_mergedAlgo selected by TSS have no model selected and will fail.
     !! Please make sure this is intended or review your selection metrics and threshold.

  > mergedData_mergedRun_mergedAlgo ensemble modeling
   ! No models kept due to threshold filtering... Ensemble Modeling will fail!
   ! Note :  GuloGulo_EMmeanByTSS_mergedData_mergedRun_mergedAlgo failed!

   ! Note :  GuloGulo_EMcaByTSS_mergedData_mergedRun_mergedAlgo failed!

! All models failed> myBiomodEM

-=-=-=-=-=-=-=-=-=-=-=-=-= BIOMOD.ensemble.models.out -=-=-=-=-=-=-=-=-=-=-=-=-=

sp.name : GuloGulo

expl.var.names : bio3 bio4 bio7 bio11 bio12


models computed: none

models failed: 
GuloGulo_EMmeanByTSS_mergedData_mergedRun_mergedAlgo, GuloGulo_EMcaByTSS_mergedData_mergedRun_mergedAlgo

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 
> # Get evaluation scores & variables importance
> get_evaluations(myBiomodEM)
Warning in .local(obj, ...) : No link provided for this object
Error in if (nrow(out) == 0) { : argument is of length zero
Calls: get_evaluations -> get_evaluations -> .local
Execution halted