ENMeval
ENMeval copied to clipboard
Removal of cell duplicates caused one or more user partition groups to be missing Error
Hello,
I am running models with ENMevaluate using a user defined partition method:
model_species <- ENMeval::ENMevaluate(occs = occs_df, envs = noncollinear_predictors, bg = bg_bias, algorithm = "maxent.jar", method = meth, partitions = 'user', user.grp = (list(occs.grp = user_partition$occs.grp, bg.grp = user_partition$bg.grp)), tune.args = list(fc = features, rm = c(0.05,0.5, 1)), # let' test 3 values parallel = FALSE, doClamp = T, updateProgress = TRUE, parallelType = "doParallel")
The model runs well for some species, but for other species I get the following error:
* Running ENMeval v2.0.4 with legacy arguments. These will be phased out in the next version.
*** Running initial checks... ***
* Found 57529 raster cells that were NA for one or more, but not all, predictor variables. Converting these cells to NA for all predictor variables.
* Removed 6 occurrence points with NA predictor variable values.
* Removed 11481 background points with NA predictor variable values.
Error in ENMeval::ENMevaluate(occs = occs_df, envs = noncollinear_predictors, :
Removal of cell duplicates caused one or more user partition groups to be missing. Please make sure all partition groups are represented by at least one non-duplicate occurrence record.
This occurs when the model removes occurrence points with NA predictor variable values. How can I tackle this issue?
Thanks
Thanks for using the pkg. This warning tells you that at least one raster is missing values for cells that multiple other rasters have values for, and in this case it's missing over 57,000 cells. The solution is to remove this raster from the stack and rerun. If even one raster is a missing value for a cell (making it NA), the model ignores the entire row, meaning that cell disappears from the training data. I would drop all your rasters into QGIS or other software and examine them. Are there large areas that are absent from one or more rasters?
The partition method should not affect this issue.
Hope this answers your question.