An error appears in the part where you enter myBiomodEM. Error in BIOMOD_EnsembleModeling.ckeck.args(modeling.output, chosen.modles, : prob.mean, prob.cv, prob.ci, prob.median, committee.averaging and prob.mean.weight arguments must be logical
It usually well, but suddenly an error appears in this part. I'd appreciate it if you could tell me how to solve it.
species <- read.csv(choose.files(),header=T)
species
path = "E:/ecology/tt/Ensemble_tif"
lst <- list.files(path=path,pattern='tif$',full.names = T)
preds <- stack(lst)
suppressWarnings(min(numeric(0), na.rm = TRUE))
SpName <- 'Pinus'
sp <- as.numeric(species[,SpName])
spXY <- species[,c('x','y')]
spExpl <- stack(lst)
myBiomodData <- BIOMOD_FormatingData(resp.var = sp,
expl.var = spExpl,
resp.xy = spXY,
resp.name = SpName)
myBiomodData
plot(myBiomodData)
myBiomodOption <- BIOMOD_ModelingOptions()
myBiomodeloutput <- BIOMOD_Modeling(
myBiomodData,
models = c('GLM','CTA','RF','MARS','FDA','GAM','ANN','GBM'),
models.options = myBiomodOption,
NbRunEval=10,
DataSplit=70,
Yweights = NULL,
Prevalence= NULL,
VarImport=7,
models.eval.meth = c('TSS','ROC'),
SaveObj = TRUE,
rescal.all.models = TRUE,
do.full.models = FALSE,
modeling.id = paste(SpName,"FirstModeling",sep=""))
myBiomodeloutput
myBiomodModelEval <- get_evaluations(myBiomodeloutput)
myBiomodModelEval
R <- myBiomodModelEval
write.csv(R, file = "E:/ecology/kk/tt/corEnvT.csv")
dimnames(myBiomodModelEval)
get_variables_importance(myBiomodeloutput)
a <- get_variables_importance(myBiomodeloutput)
write.csv(a, file = "E:/ecology/kk/tt/corEnvT.csv")
myBiomodEM <- BIOMOD_EnsembleModeling(
modeling.output = myBiomodeloutput,
chosen.models = 'all',
em.by='all',
eval.metric = c('TSS'),
eval.metric.quality.threshold = c(0.8),
prob.mean = T,
prob.cv = T,
prob.ci = T,
prob.ci.alpha = 0.05,
prob.median = T,
committee.averaging = T,
prob.mean.weight = T,
prob.mean.weight.decay = 'proportional')
myBiomodEM
get_evaluations(myBiomodEM)
myBiomodProj <- BIOMOD_Projection(
modeling.output = myBiomodeloutput,
new.env = spExpl,
proj.name = 'current',
selected.models = 'all',
binary.meth = 'TSS',
compress = 'xz',
clamping.mask = T,
output.format = '.img',
prob.mean.weight = T,
prob.mean.weight.decay = 'proportional')
myBiomodProj
myCurrentProj <- get_predictions(myBiomodProj)
myCurrentProj
myBiomodEF <- BIOMOD_EnsembleForecasting(
EM.output = myBiomodEM,
projection.output = myBiomodProj)
myBiomodEF
In addition, the result could be exported as a TIF file in the SSDM package, but I wonder whether the completed result is exported as a GIS TIF file within the BIOOD2 package.
I'd really appreciate it if you let me know
I tried to change the code after watching the tutorial, but I don't know what's wrong because it's the same as my code.