- using R version 4.2.3 (2023-03-15 ucrt)
- using platform: x86_64-w64-mingw32 (64-bit)
- using session charset: UTF-8
- checking for file 'biomod2/DESCRIPTION' ... OK
- checking extension type ... Package
- this is package 'biomod2' version '4.2-4'
- package encoding: UTF-8
- checking package namespace information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking whether package 'biomod2' can be installed ... OK
See the install log for details.
- checking installed package size ... OK
- checking package directory ... OK
- checking 'build' directory ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking R files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... OK
- checking whether the package can be loaded with stated dependencies ... OK
- checking whether the package can be unloaded cleanly ... OK
- checking whether the namespace can be loaded with stated dependencies ... OK
- checking whether the namespace can be unloaded cleanly ... OK
- checking loading without being on the library search path ... OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [49s] OK
- checking Rd files ... [3s] OK
- checking Rd metadata ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking contents of 'data' directory ... OK
- checking data for non-ASCII characters ... OK
- checking LazyData ... OK
- checking data for ASCII and uncompressed saves ... OK
- checking installed files from 'inst/doc' ... OK
- checking files in 'vignettes' ... OK
- checking examples ... [35s] ERROR
Running examples in 'biomod2-Ex.R' failed
The error most likely occurred in:
> ### 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.71
> # 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
- checking for unstated dependencies in vignettes ... OK
- checking package vignettes in 'inst/doc' ... OK
- checking re-building of vignette outputs ... [4s] OK
- checking PDF version of manual ... OK
- DONE
Status: 1 ERROR