ENMeval icon indicating copy to clipboard operation
ENMeval copied to clipboard

Clamp error when projecting maxnet model

Open aanaranjo opened this issue 1 year ago • 1 comments

Similar to issue #112, I am in the process of trying to project my 'maxnet' results from 'ENMEvaluate' (after getting a SIGSEGV error trying to use maxent.jar that aborted my R session). I have the following code (which is based off of both the ENMEval vignette and the issue # mentioned above):

mods.maxnet <- eval.models(modeval) #modeval= output from ENMEvaluate os <- list(abs.auc.diff = FALSE, validation.bg = "partition") #avoided using pred.type, only for Maxent ref.vals <- raster::extract(envStack, bg, method = 'simple', na.rm = TRUE) #envStack= present variables futureStack <- clamp.vars(futureStack, ref.vals, left = NULL, right = NULL, categoricals = NULL) future <- maxnet.predict(mods.maxnet$fc.L_rm.1, futureStack, os)

But receive this error: Error in if (clamp) { : argument is of length zero

I also tried this with the 'enm.maxnet@predict' function and got the same error. What could be going on? Thanks!

aanaranjo avatar Oct 13 '23 21:10 aanaranjo

So sorry for the very late reply. And sorry to hear your prediction wasn't working. I am in the process of making a new updated version that replaces terra with raster, and in the process I restored the maxnet.predictRaster function. Please install the dev branch and test it out. There's an updated example in ?ENMevaluate.

remotes::install_github("jamiemkass/ENMeval@v205_draft")

Please let me know if this fixes it. This version will replace the one on CRAN shortly.

jamiemkass avatar Jan 25 '24 06:01 jamiemkass