## Not run:
# # Loading test data for the niche dynamics analysis in the invaded range
# inv <- ecospat.testNiche.inv
#
# # species occurrences
# xy <- inv[,1:2]
# sp_occ <- inv[11]
#
# # env
# current <- inv[3:10]
#
#
#
# ### Formating the data with the BIOMOD_FormatingData() function form the package biomod2
# setwd(path.wd)
# t1 <- Sys.time()
# sp <- 1
# myBiomodData <- BIOMOD_FormatingData( resp.var = as.numeric(sp_occ[,sp]),
# expl.var = current,
# resp.xy = xy,
# resp.name = colnames(sp_occ)[sp])
#
# myBiomodOption <- Print_Default_ModelingOptions()
#
#
# ### Calibration of simple bivariate models
# my.ESM <- ecospat.ESM.Modeling( data=myBiomodData,
# models=c('GLM','RF'),
# models.options=myBiomodOption,
# NbRunEval=2,
# DataSplit=70,
# weighting.score=c("AUC"),
# parallel=F)
#
#
# ### Evaluation and average of simple bivariate models to ESMs
# my.ESM_EF <- ecospat.ESM.EnsembleModeling(my.ESM,weighting.score=c("SomersD"),threshold=0)
#
# ### Projection of simple bivariate models into new space
# my.ESM_proj_current<-ecospat.ESM.Projection(ESM.modeling.output=my.ESM,
# new.env=current)
#
# ### Projection of calibrated ESMs into new space
# my.ESM_EFproj_current <- ecospat.ESM.EnsembleProjection(ESM.prediction.output=my.ESM_proj_current,
# ESM.EnsembleModeling.output=my.ESM_EF)
#
# ## End(Not run)
Run the code above in your browser using DataCamp Workspace