marlonecobos / kuenm

kuenm: An R package for detailed calibration and construction of Maxent Ecological Niche Models.
63 stars 24 forks source link

Kuenm_mop - RasterBrick/RasterStack error #51

Closed ThomasOsinga closed 1 year ago

ThomasOsinga commented 1 year ago

When running the MOP analysis I get the following error: Error in if (class(M1) == "RasterBrick" | class(M1) == "RasterStack" | : the condition has length > 1

Using the following code ############################################################## library(kuenm) library(raster)

setwd("D:/Forest and Nature Conservation - Jaar 1/WEC/Maxent/G_variables/Set_78/Future") list <- list.files(pattern="\.asc") setwd("D:/Forest and Nature Conservation - Jaar 1/WEC/Maxent/M_variables/Set_78/") listm<- list.files(pattern="\.asc")

G.stack <- stack(list) M.stack <- stack(listm)

kuenm_mop(M.stack, G.stack, percent = 10, comp.each = 2000, parallel = FALSE, n.cores = NULL) #################################################################

Both rasterstacks are Identical (besides one is future prediction...)

I've been searching for a fix but nothing seems to work, any ideas?

marlonecobos commented 1 year ago

That issue should be fixed in the last version of the package. Try to reinstall it.