Closed preuss96 closed 4 years ago
Update to the last version of SSDM on GitHub and use stack_modelling
and project
functions.
I updated that and now I cant run the stack_modelling, even with 76 species, which had successfully predict with the other SSDM version.
I got this error:
Error in stack_modelling("MAXENT", Occ, Env1, Xcol = "longitude", Ycol = "latitude", : Less than two species models were retained, you should lower the ensemble threshold value (ensemble.thresh parameter).
The threshold is already in 0.1 and this error continues
Here is a minimal example with package data:
SSDM <- stack_modelling('MAXENT', Occurrences, Env, rep = 1, Xcol = 'LONGITUDE', Ycol = 'LATITUDE', Spcol = 'SPECIES', ensemble.thresh = 0.3,verbose = TRUE, cores = 7)
Error in stack_modelling("MAXENT", Occurrences, Env, rep = 1, Xcol = "LONGITUDE", : Less than two species models were retained, you should lower the ensemble threshold value (ensemble.thresh parameter).
I also tried with other algorithms without success
Did you forgot the maxent.jar
in the dismo
installation ? Anyway the minimal example in the last version should work.
I have maxent.jar in dismo installation, and its not working.
I also tried with other algorithms. All of them presents the same error:
Error in stack_modelling("MAXENT", Occ, Env1, Xcol = "longitude", Ycol = "latitude", : Less than two species models were retained, you should lower the ensemble threshold value (ensemble.thresh parameter).
When I try with package data (Occurrences and Env) using GLM algorithm, I got this error:
Error in checkForRemoteErrors(val) : one node produced an error: Error in loadNamespace(name) : there is no package called 'sdm'
So I downloaded sdm package and the threshold error continues
Please give a full minimal example with SSDM
data and corresponding R code and console outputs in a logfile
Could also be a parallelization issue... can you please check running with cores=0
?
Hello
I need to project the maxent model to the future with the "project" function.
I am finding some problems even after saw the issues on github.
I am doing a stacked.SDM from maxent and I tried to use your function to change maxent with get_model:
setMethod("get_model", "MAXENT.SDM", function(obj, Env, ...) { factors <- c() for (i in 4:length(names(obj@data))) { if (is.factor(obj@data[, i])) { factors <- c(factors, names(obj@data)[i]) } } model <- maxent(x = Env, p = obj@data[which(obj@data$Presence == 1), 1:2], a = obj@data[which(obj@data$Presence == 0), 1:2], factors = factors) return(model) })
However I am finding this error:
Error in conformMethod(signature, mnames, fnames, f, fdef, definition) : in method for ‘get_model’ with signature ‘x="MAXENT.SDM"’: formal arguments (x = "MAXENT.SDM", ... = "MAXENT.SDM") omitted in the method definition cannot be in the signature
My code is:
SSDM <- stack_modelling("MAXENT", Occ, Env1, Xcol = "longitude", Ycol = "latitude", Pcol = NULL, Spcol = "Especie", rep = 2, name = NULL, save = TRUE, path = 'C:/Users/Gabriel/Desktop/Dissertação/Bats/Dissertation/model_atual', PA = NULL, cv = "holdout", cv.param = c(0.75, 1), thresh = 100, axes.metric = "Pearson", uncertainty = TRUE, tmp = TRUE, ensemble.metric = c("AUC"), ensemble.thresh = c(0.5), weight = TRUE, method = "pSSDM", metric = "SES", range = NULL, endemism = c("WEI", "Binary"), verbose = TRUE, cores=7)
I try to project like this:
Error in maxent(x = Env, p = obj@data[which(obj@data$Presence == 1), 1:2], : argument "Env" is missing, with no default
May you help me, please?