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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: BIOMOD_Report
> ### Title: Produce summary outputs from a simulation folder
> ### Aliases: BIOMOD_Report
> ### Keywords: ODMAP html markdown report
> 
> ### ** Examples
> 
> library(terra)
terra 1.8.93

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)
> 
>  
> # --------------------------------------------------------------- #
> 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.name = myRespName,
+                                        resp.var = myResp,
+                                        resp.xy = myRespXY,
+                                        expl.var = myExpl)
+ 
+   # Model single models
+   myBiomodModelOut <- BIOMOD_Modeling(bm.format = myBiomodData,
+                                       modeling.id = 'AllModels',
+                                       models = c('RF', 'GLM'),
+                                       CV.strategy = 'random',
+                                       CV.nb.rep = 2,
+                                       CV.perc = 0.8,
+                                       OPT.strategy = 'bigboss',
+                                       metric.eval = c('TSS', 'AUCroc'),
+                                       var.import = 3,
+                                       seed.val = 42)
+ }
> 
> 
> file.proj <- paste0(myRespName, "/proj_Current/", myRespName, ".Current.projection.out")
> if (file.exists(file.proj)) {
+   myBiomodProj <- get(load(file.proj))
+ } else {
+ 
+   # Project single models
+   myBiomodProj <- BIOMOD_Projection(bm.mod = myBiomodModelOut,
+                                     proj.name = 'Current',
+                                     new.env = myExpl,
+                                     models.chosen = 'all',
+                                     build.clamping.mask = TRUE)
+ }
> 
> 
> file.EM <- paste0(myRespName, "/", myRespName, ".AllModels.ensemble.models.out")
> if (file.exists(file.EM)) {
+   myBiomodEM <- get(load(file.EM))
+ } else {
+ 
+   # 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', 'AUCroc'),
+                                         var.import = 3,
+                                         seed.val = 42)
+ }
> 
> 
> # --------------------------------------------------------------- #
> # Compile summary reports
> # BIOMOD_Report(bm.out = myBiomodModelOut, strategy = 'report')
> # BIOMOD_Report(bm.out = myBiomodProj, strategy = 'report')
> # BIOMOD_Report(bm.out = myBiomodEM, strategy = 'report')
>  
> BIOMOD_Report(bm.out = myBiomodModelOut, strategy = 'ODMAP')

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Do biomod2 Report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

	> Getting modeling files...
	> Building report...

processing file: biomod2_template_ODMAP.Rmd
Warning in file(con, "w") :
  cannot open file 'biomod2_template_ODMAP.knit.md': Read-only file system
Error in file(con, "w") : cannot open the connection
Calls: BIOMOD_Report ... <Anonymous> -> <Anonymous> -> write_utf8 -> writeLines -> file
Execution halted
Examples with CPU (user + system) or elapsed time > 5s
                  user system elapsed
BIOMOD_RangeSize 4.678  0.073   6.366
BIOMOD_Modeling  3.324  0.047   5.056