Open ameliabridges opened 9 months ago
Hi @sgvignali, I also had the same error, simply following the code shown in the vignettes, but with my own data, both using ANN and RF as methods.
This is the code which produces the error, I tryed using ext
(the extent of my predictors) to solve it but nothing change:
map_rf <- predict(final_model_rf,
data = EnvVars,
ext = extvars)
All other analysis performed well, only when producing the prediction map it comes this problem. This is my sessionInfo:
R version 4.2.3 (2023-03-15 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22631)
Matrix products: default
locale:
[1] LC_COLLATE=Italian_Italy.utf8 LC_CTYPE=Italian_Italy.utf8 LC_MONETARY=Italian_Italy.utf8
[4] LC_NUMERIC=C LC_TIME=Italian_Italy.utf8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] plotROC_2.3.1 ggplot2_3.4.4 terra_1.7-29 zeallot_0.1.0 SDMtune_1.3.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.10 pillar_1.9.0 compiler_4.2.3 plyr_1.8.8 tools_4.2.3
[6] jsonlite_1.8.8 lifecycle_1.0.3 tibble_3.2.1 gtable_0.3.1 lattice_0.20-45
[11] pkgconfig_2.0.3 rlang_1.1.2 cli_3.6.2 rstudioapi_0.14 dismo_1.3-14
[16] withr_2.5.0 dplyr_1.1.4 raster_3.6-3 generics_0.1.3 vctrs_0.6.5
[21] grid_4.2.3 nnet_7.3-18 tidyselect_1.2.0 glue_1.6.2 R6_2.5.1
[26] fansi_1.0.3 sp_1.5-1 farver_2.1.1 magrittr_2.0.3 whisker_0.4
[31] scales_1.2.1 codetools_0.2-19 randomForest_4.7-1.1 colorspace_2.0-3 labeling_0.4.2
[36] utf8_1.2.2 munsell_0.5.0
Describe the bug
When trying to use SDMtune::predict() to extract predictors over the entire extent of the environmental rasters, the following error is produced: Error in find_dims(object, model, nc, fun, const, na.rm, index, ...) : could not find function "find_dims"
Calculating predictions for the pres/abs locations using the swd object as opposed to the predictors object works fine.
Steps to reproduce the bug
Session information
Additional information
No response
Reproducible example