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
RE: Error in gzfile(file, "wb") : cannot open the connection [ Reply ]
By: Joana Carvalho on 2018-12-07 11:22
[forum:46463]
Thanks Damien! In fact, the mistake was mine, I had wrote spe="" instead of spe="". I have no idea how I could manage it as I had copied the example suggested in the tutorial for multi-species modelling....but it is working now and thank you so much for helping and developing such a great package!
Best,
Joana

RE: Error in gzfile(file, "wb") : cannot open the connection [ Reply ]
By: damien georges on 2018-12-07 10:37
[forum:46461]
Dear Joana,

My guess is that error might come from the spaces in the modelling.id specification (i.e. 'gbb FirstModeling ').

You wrote :

modeling.id=paste(myRespName,"FirstModeling",spe=""))

but I think you wanted to write :

modeling.id=paste(.... , sep = ""))

Hope that helps,
Damien

Error in gzfile(file, "wb") : cannot open the connection [ Reply ]
By: Joana Carvalho on 2018-12-06 21:22
[forum:46460]
Hi all,

I am trying to run a multi-species SDM using biomod2, however I am encountering the following error and warning messages in the modeling step:

Loading required library...

Checking Models arguments...

Creating suitable Workdir...
Error in gzfile(file, "wb") : cannot open the connection
In addition: Warning message:
In gzfile(file, "wb") :
cannot open compressed file 'gbb/.BIOMOD_DATA/gbb FirstModeling /formated.input.data', probable reason 'No such file or directory'



Here is the script I am using, which follows the tutorial:

library(biomod2)
library(dismo)
library(rgdal)

## species occurrence data

setwd('D:/Dropbox/all_species')
#setwd('C:/all_species')

apes<-read.table('./apes_data/all apes.txt', header = TRUE, sep = "")


## environmental data
files<-list.files(path='./context_data/', pattern='txt', full.names=T)
predictors <- stack(files)

myExpl=predictors



## define species of interest
sp.names<-c('gbb','gbg','ggg','ggd','ppan','ptv','pte','ptt','pts')

## only one species
#myRespName = 'gbb'

## loop on species == applying the same functions tto each species

for(sp.n in sp.names){
myRespName = sp.n

cat('\n',myRespName,'modeling...')
### definition of data
## i.e keep only the column of our species
myResp <- as.numeric(apes[,myRespName])
myRespCoord = apes[c('lon','lat')]


### Initialisation
myBiomodData <- BIOMOD_FormatingData(resp.var = myResp,
expl.var = myExpl,
resp.xy = myRespCoord,
resp.name = myRespName)

## Options algorithms
myBiomodOption <- BIOMOD_ModelingOptions()


## Modelling
myBiomodModelOut<-BIOMOD_Modeling(myBiomodData,
models=c('GLM','GAM','ANN','RF'),
models.options=myBiomodOption,
NbRunEval=3,
DataSplit=80, # %data to calibrate
#Prevalence=0, #if PA.nb.rep>0 above, this will assume (by default) prevalence =0.5
Prevalence=0.5, # =weight of presences than absences
VarImport=3,
models.eval.meth = c('TSS','ROC'), # define statistic metrics
SaveObj=TRUE,
rescal.all.models=TRUE,
do.full.models=FALSE,
modeling.id=paste(myRespName,"FirstModeling",spe=""))


It seems that the problem is with the last argument of the BIOMOD_Modeling function (modeling.id) as the script works omitting modeling.id.

Any help would be very much appreciated!

Thanks,

Joana


R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

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

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

other attached packages:
[1] rgdal_1.3-3 dismo_1.1-4 biomod2_3.3-7 ggplot2_3.0.0 reshape_0.8.8 raster_2.6-7 sp_1.3-1

loaded via a namespace (and not attached):
[1] gbm_2.1.4 zoo_1.8-4 tidyselect_0.2.4 slam_0.1-43 NLP_0.2-0
[6] purrr_0.2.5 splines_3.5.1 lattice_0.20-35 colorspace_1.3-2 viridisLite_0.3.0
[11] mgcv_1.8-24 survival_2.42-3 rlang_0.2.1 hexbin_1.27.2 pillar_1.3.0
[16] glue_1.3.0 withr_2.1.2 RColorBrewer_1.1-2 plotmo_3.5.0 bindrcpp_0.2.2
[21] bindr_0.1.1 plyr_1.8.4 mda_0.4-10 munsell_0.5.0 gtable_0.2.0
[26] latticeExtra_0.6-28 SparseM_1.77 tm_0.7-5 class_7.3-14 maxent_1.3.3.1
[31] Rcpp_0.12.18 scales_1.0.0 plotrix_3.7-4 abind_1.4-5 gridExtra_2.3
[36] TeachingDemos_2.10 dplyr_0.7.6 rasterVis_0.45 grid_3.5.1 tools_3.5.1
[41] magrittr_1.5 PresenceAbsence_1.1.9 lazyeval_0.2.1 tibble_1.4.2 randomForest_4.6-14
[46] crayon_1.3.4 pkgconfig_2.0.1 MASS_7.3-50 Matrix_1.2-14 xml2_1.2.0
[51] pROC_1.13.0 assertthat_0.2.0 earth_4.6.3 R6_2.2.2 rpart_4.1-13
[56] nlme_3.1-137 nnet_7.3-12 compiler_3.5.1



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