# NOT RUN {
   
# }
# NOT RUN {
library(biomod2)
# Loading test data
data(ecospat.testNiche.inv)
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 from the package biomod2
sp <- 1
myBiomodData <- BIOMOD_FormatingData( resp.var = as.numeric(sp_occ[,sp]),
                                      expl.var = current,
                                      resp.xy = xy,
                                      resp.name = colnames(sp_occ)[sp])
### Calibration of simple bivariate models
my.ESM <- ecospat.ESM.Modeling( data=myBiomodData,
                                models=c('GLM','CTA'),
                                NbRunEval=2,
                                DataSplit=70,
                                weighting.score=c('AUC'),
                                parallel=FALSE)  
### Evaluation and average of simple bivariate models to ESMs
my.ESM_EF <- ecospat.ESM.EnsembleModeling(my.ESM,weighting.score=c('SomersD'),threshold=0)
output.TH <- ecospat.ESM.threshold(my.ESM_EF,PEplot = TRUE)
# }
Run the code above in your browser using DataLab