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

> ### Name: bm_CrossValidation
> ### Title: Build cross-validation table
> ### Aliases: bm_CrossValidation bm_CrossValidation_user.defined
> ###   bm_CrossValidation_user.defined,BIOMOD.formated.data-method
> ###   bm_CrossValidation_user.defined,BIOMOD.formated.data.PA-method
> ###   bm_CrossValidation_random
> ###   bm_CrossValidation_random,BIOMOD.formated.data-method
> ###   bm_CrossValidation_random,BIOMOD.formated.data.PA-method
> ###   bm_CrossValidation_kfold
> ###   bm_CrossValidation_kfold,BIOMOD.formated.data-method
> ###   bm_CrossValidation_kfold,BIOMOD.formated.data.PA-method
> ###   bm_CrossValidation_block
> ###   bm_CrossValidation_block,BIOMOD.formated.data-method
> ###   bm_CrossValidation_block,BIOMOD.formated.data.PA-method
> ###   bm_CrossValidation_strat
> ###   bm_CrossValidation_strat,BIOMOD.formated.data-method
> ###   bm_CrossValidation_strat,BIOMOD.formated.data.PA-method
> ###   bm_CrossValidation_env
> ###   bm_CrossValidation_env,BIOMOD.formated.data-method
> ###   bm_CrossValidation_env,BIOMOD.formated.data.PA-method
> 
> ### ** Examples
> 
> library(terra)
terra 1.9.11

Attaching package: ‘terra’

The following object is masked from ‘package:plotrix’:

    rescale

> 
> # 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)
> 
> # --------------------------------------------------------------- #
> # Format Data with true absences
> myBiomodData <- BIOMOD_FormatingData(resp.name = myRespName,
+                                      resp.var = myResp,
+                                      resp.xy = myRespXY,
+                                      expl.var = myExpl)

-=-=-=-=-=-=-=-=-=-=-=-=-=-= GuloGulo Data Formating -=-=-=-=-=-=-=-=-=-=-=-=-=-=

 !!! Some data are located in the same raster cell. 
          Please set `filter.raster = TRUE` if you want an automatic filtering.
 ! Some NAs have been automatically removed from your data
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Done -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 
> # --------------------------------------------------------------- #
> # Create the different validation datasets
> 
> # random selection
> cv.r <- bm_CrossValidation(bm.format = myBiomodData,
+                            strategy = "random",
+                            nb.rep = 3,
+                            k = 0.8)


Checking Cross-Validation arguments...

   > Random cross-validation selection
> 
> # k-fold selection
> cv.k <- bm_CrossValidation(bm.format = myBiomodData,
+                            strategy = "kfold",
+                            nb.rep = 2,
+                            k = 3)


Checking Cross-Validation arguments...

   > k-fold cross-validation selection
> 
> # block selection
> cv.b <- bm_CrossValidation(bm.format = myBiomodData,
+                            strategy = "block")


Checking Cross-Validation arguments...

   > Block cross-validation selectionError in .local(bm.format, ...) : Package 'ENMeval' not found
Calls: bm_CrossValidation ... bm_CrossValidation_block -> bm_CrossValidation_block -> .local
Execution halted