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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: BIOMOD_RangeSize
> ### Title: Analyze the range size differences between projections of
> ###   species distribution models
> ### Aliases: BIOMOD_RangeSize BIOMOD_RangeSize,data.frame,data.frame-method
> ###   BIOMOD_RangeSize,SpatRaster,SpatRaster-method
> ### Keywords: "species change" gain loss projections range
> 
> ### ** Examples
> 
> library(terra)
terra 1.7.55
> 
> # 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)
+ }
> 
> models.proj <- get_built_models(myBiomodModelOut, algo = "RF")
>   # Project single models
>   myBiomodProj <- BIOMOD_Projection(bm.mod = myBiomodModelOut,
+                                     proj.name = 'CurrentRangeSize',
+                                     new.env = myExpl,
+                                     models.chosen = models.proj,
+                                     metric.binary = 'all',
+                                     build.clamping.mask = TRUE)

-=-=-=-=-=-=-=-=-=-=-=-=-= Do Single Models Projection -=-=-=-=-=-=-=-=-=-=-=-=-=

	> Building clamping mask

	> Projecting GuloGulo_allData_RUN1_RF ...
	> Projecting GuloGulo_allData_RUN2_RF ...

	> Building TSS binaries / filtered
	> Building ROC binaries / filtered

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Done -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 
> 
> # --------------------------------------------------------------- #
> # Load environmental variables extracted from BIOCLIM (bio_3, bio_4, bio_7, bio_11 & bio_12)
> data(bioclim_future)
> myExplFuture <- terra::rast(bioclim_future)
> ## Don't show: 
> myExtent <- terra::ext(0,30,45,70)
> myExplFuture <- terra::crop(myExplFuture, myExtent)
> ## End(Don't show)
> # Project onto future conditions
> myBiomodProjectionFuture <- BIOMOD_Projection(bm.mod = myBiomodModelOut,
+                                               proj.name = 'FutureRangeSize',
+                                               new.env = myExplFuture,
+                                               models.chosen = models.proj,
+                                               metric.binary = 'TSS')

-=-=-=-=-=-=-=-=-=-=-=-=-= Do Single Models Projection -=-=-=-=-=-=-=-=-=-=-=-=-=

	> Building clamping mask

	> Projecting GuloGulo_allData_RUN1_RF ...
	> Projecting GuloGulo_allData_RUN2_RF ...

	> Building TSS binaries / filtered

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Done -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 
> # Load current and future binary projections
> CurrentProj <- get_predictions(myBiomodProj,
+                                metric.binary = "TSS",
+                                model.as.col = TRUE)
> FutureProj <- get_predictions(myBiomodProjectionFuture,
+                                metric.binary = "TSS",
+                                model.as.col = TRUE)
> # Compute differences
> myBiomodRangeSize <- BIOMOD_RangeSize(proj.current = CurrentProj, proj.future = FutureProj)

-=-=-=-=-=-=-=-=-=-=-=-=-= Do Range Size Computation -=-=-=-=-=-=-=-=-=-=-=-=-=

 Each projection in 'proj.current' will be compared once with its corresponding projection in 'proj.future'. 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Done -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 
> myBiomodRangeSize$Compt.By.Models
                         Loss Stable0 Stable1 Gain PercLoss PercGain
GuloGulo_allData_RUN1_RF   15      45      10    0       60        0
GuloGulo_allData_RUN2_RF   11      50       9    0       55        0
                         SpeciesRangeChange CurrentRangeSize
GuloGulo_allData_RUN1_RF                -60               25
GuloGulo_allData_RUN2_RF                -55               20
                         FutureRangeSize.NoDisp FutureRangeSize.FullDisp
GuloGulo_allData_RUN1_RF                     10                       10
GuloGulo_allData_RUN2_RF                      9                        9
> plot(myBiomodRangeSize$Diff.By.Pixel)
> 
> # Represent main results 
> bm_PlotRangeSize(bm.range = myBiomodRangeSize)
Warning in bm_PlotRangeSize(bm.range = myBiomodRangeSize) :
  Please check that rownames(bm.range$Compt.By.Models) match 'row.names' argument :
	GuloGulo : Species
	allData : Dataset
	RUN1 : Run
	RF : Algo
Error in bm_PlotRangeSize(bm.range = myBiomodRangeSize) : 
  Package 'ggpubr' not found
Execution halted