SCM

Forum: biomod2 package is now available !

Posted by: damien georges
Date: 2012-07-26 13:56
Summary: biomod2 package is now available !
Project: BioMod

Content:

Dear BIOMOD-users,

You were eagerly waiting for it, and we are happy to say that the new version of BIOMOD called biomod2 is now online on R-Forge.

Although we kept the same modelling philosophy than the former version (which we will still maintain for a while), we have made crucial changes. biomod2 is now fully object-oriented and made for running on a single species only (see vignette MultiSpeciesModelling for multi-species modelling at once). For advanced BIOMOD users, the new functions might be a bit disturbing at the beginning. Then, you will see that this new version is much more advanced and practical than the former ones. Among the novelties, the addition of MAXENT in the modelling techniques, a large range of evaluation metrics, a more refined definition of ensemble modelling and ensemble forecasting, the possibility to give presence-only data and environmental rasters to biomod2 and let it extract pseudo-absence data directly.

We have created several vignettes for you to get use to this new version and a figure explaining the different ways of giving data to BIOMOD.

Please bear in mind that R-Forge is a development platform, it means that this new package would experience repeated updating the next couple of weeks (correcting bugs, adding documentation, adding functionalities) so think about updating the package before each new study you will do.

Last but not least, all comments are welcome! If you find a bug, if you think some documentation points are unclear, if you think about new functionalities that may be useful, just let us know ASAP.

We count on you to help finalizing this new version to a very nice tool. We will then release it to CRAN by the end of July. Please remember to add your code, R-version, OS and BIOMOD-version every time you report a bug or a mistake in the vignette or help files.

Hoping you will enjoy this new version of BIOMOD.

With our best wishes,

Damien & Wilfried

Latest News

biomod2 is now devel on github

damien georges - 2020-03-02 17:08 -

biomod2 package is now available !

damien georges - 2012-07-26 13:56 -
...

 

Monitor Forum | Start New Thread Start New Thread
Error in file(file, "rt") : cannot open the connection [ Reply ]
By: Olef Koch on 2020-07-27 09:48
[forum:48336]
Hi all,

when running Biomod2 with multiple models on a single species, I get this error message for the MAXENT.Phillips model:

Model=MAXENT.Phillips
Creating Maxent Temp Proj Data..
Running Maxent...
Getting predictions...Error in file(file, "rt") : cannot open the connection
In addition: Warning messages:
1: In newton(lsp = lsp, X = G$X, y = G$y, Eb = G$Eb, UrS = G$UrS, L = G$L, :
Iteration limit reached without full convergence - check carefully
2: package ‘gbm’ was built under R version 3.6.3
3: In system(command = maxent.cmd, wait = TRUE, intern = TRUE, ignore.stdout = FALSE, :
running command 'java -mx512m -jar C:/SDM/R/maxent.jar environmentallayers="Ensete.ventricosum/models/1595841776/m_10768939/Back_swd.csv" samplesfile="Ensete.ventricosum/models/1595841776/m_10768939/Sp_swd.csv" projectionlayers="Ensete.ventricosum/models/1595841776/m_10768939/Predictions/Pred_swd.csv" outputdirectory="Ensete.ventricosum/models/1595841776/Ensete.ventricosum_PA1_RUN1_MAXENT.Phillips_outputs" outputformat=logistic redoifexists visible=FALSE linear=TRUE quadratic=TRUE product=TRUE threshold=TRUE hinge=TRUE lq2lqptthreshold=80 l2lqthreshold=10 hingethreshold=15 beta_threshold=-1 beta_categorical=-1 beta_lqp=-1 beta_hinge=-1 betamultiplier=1 defaultprevalence=0.5 autorun nowarnings notooltips noaddsamplestobackground' had status 1
4: In file(file, "rt") :
cannot open file 'Ensete.ventricosum/models/1595841776/Ensete.ventricosum_PA1_RUN1_MAXENT.Phillips_outputs/Ensete.ventricosum_PA1_RUN1_Pred_swd.csv': No such file or directory

Removing Maxent Temp Data..
*** inherits(g.pred,'try-error')
! Note : Ensete.ventricosum_PA1_RUN1_MAXENT.Phillips failed!


This is the code I used:

# 0. Load data & Selecting Data
# species occurrences
DataEnset <- read.csv("C:/SDM/Data/Location/Sample_120/enset_dom_sample2.csv")
head(DataEnset)

DataEnsetCluster120<-subset(DataEnset,Cluster_sample=="TRUE")
head(DataEnsetCluster120)

# the name of studied species
RespName <- 'Ensete_ventricosum'

# the presence/absences data for our species
E_ventricosum_dom <- as.numeric(DataEnsetCluster120[,"Species"])

# the XY coordinates of species data
E_ventricosum_dom_XY <- DataEnsetCluster120[,c("Longitude","Latitude")]
head(E_ventricosum_dom_XY)

# Environmental variables from CHELSA (bio_1-19)

Expl_reference = stack( ch_bio01_reference,
ch_bio02_reference,
ch_bio03_reference,
ch_bio04_reference,
ch_bio04_reference,
ch_bio05_reference,
ch_bio06_reference,
ch_bio07_reference,
ch_bio08_reference,
ch_bio09_reference,
ch_bio10_reference,
ch_bio11_reference,
ch_bio12_reference,
ch_bio13_reference,
ch_bio14_reference,
ch_bio15_reference,
ch_bio16_reference,
ch_bio17_reference,
ch_bio18_reference,
ch_bio19_reference)

# 1. Formatting Data
myBiomodData_var_imp <- BIOMOD_FormatingData (resp.var = E_ventricosum_dom,
expl.var = Expl_reference,
resp.xy = E_ventricosum_dom_XY,
resp.name = RespName,
PA.nb.rep=10,
PA.nb.absences=100,
PA.strategy="sre",
PA.sre.quant=0.025)

# 2. Defining Models Options using default options.
myBiomodOption <- BIOMOD_ModelingOptions(GAM = list(k=3))

Print_Default_ModelingOptions()

# 3. Doing Modelisation
myBiomodModelOut_var_imp <- BIOMOD_Modeling( myBiomodData_var_imp,
models = c('GLM',"GAM","GBM",'CTA',"MARS",'RF',"MAXENT.Phillips"),
models.options = myBiomodOption,
NbRunEval=1,
DataSplit=80,
Yweights=NULL,
VarImport=3,
models.eval.meth = c('TSS',"ROC"),
SaveObj = TRUE,
rescal.all.models = FALSE,
do.full.models = FALSE)


I would be happy about any suggestions on how to fix this.

Thanks,
Olef

sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C LC_TIME=English_United Kingdom.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] gbm_2.1.8 biomod2_3.4.12 factoextra_1.0.7 ggplot2_3.3.2 tibble_3.0.3

loaded via a namespace (and not attached):
[1] nlme_3.1-142 lubridate_1.7.9 doParallel_1.0.15 RColorBrewer_1.1-2 tools_3.6.2 backports_1.1.5
[7] R6_2.4.1 rpart_4.1-15 mgcv_1.8-31 colorspace_1.4-1 nnet_7.3-12 raster_3.0-12
[13] withr_2.1.2 maxnet_0.1.2 sp_1.4-1 tidyselect_1.1.0 curl_4.3 compiler_3.6.2
[19] mda_0.5-2 labeling_0.3 scales_1.1.0 checkmate_2.0.0 hexbin_1.28.1 randomForest_4.6-14
[25] plotmo_3.5.7 PresenceAbsence_1.1.9 stringr_1.4.0 digest_0.6.25 foreign_0.8-72 dismo_1.1-4
[31] rio_0.5.16 jpeg_0.1-8.1 pkgconfig_2.0.3 plotrix_3.7-8 rlang_0.4.7 readxl_1.3.1
[37] rstudioapi_0.11 farver_2.0.3 generics_0.0.2 zoo_1.8-8 ModelMetrics_1.2.2.2 dplyr_0.8.5
[43] zip_2.0.4 car_3.0-8 magrittr_1.5 Formula_1.2-3 Matrix_1.2-18 Rcpp_1.0.3
[49] munsell_0.5.0 abind_1.4-5 lifecycle_0.2.0 stringi_1.4.6 pROC_1.16.2 carData_3.0-4
[55] MASS_7.3-51.4 plyr_1.8.6 recipes_0.1.13 grid_3.6.2 parallel_3.6.2 earth_5.1.2
[61] ggrepel_0.8.2 forcats_0.5.0 crayon_1.3.4 rasterVis_0.48 lattice_0.20-41 haven_2.3.1
[67] splines_3.6.2 hms_0.5.3 pillar_1.4.3 ggpubr_0.4.0 ggsignif_0.6.0 stats4_3.6.2
[73] reshape2_1.4.4 codetools_0.2-16 glue_1.3.1 latticeExtra_0.6-29 data.table_1.12.8 vctrs_0.3.1
[79] png_0.1-7 foreach_1.5.0 cellranger_1.1.0 gtable_0.3.0 purrr_0.3.3 tidyr_1.1.0
[85] reshape_0.8.8 assertthat_0.2.1 TeachingDemos_2.12 gower_0.2.2 openxlsx_4.1.5 prodlim_2019.11.13
[91] broom_0.7.0 rstatix_0.6.0 class_7.3-15 survival_3.2-3 viridisLite_0.3.0 timeDate_3043.102
[97] iterators_1.0.12 lava_1.6.7 ENMeval_0.3.0 ellipsis_0.3.0 caret_6.0-86 ipred_0.9-9

Thanks to:
Vienna University of Economics and Business Powered By FusionForge