The current memory allocation using options(java.parameters = "- Xmx16g")
raises the following error when running dismo::maxent(...)
Loading required namespace: rJava
Unrecognized option: - Xmx16g
Error in .jinit(parameters = parameters) :
Unable to create a Java class loader.
In addition: Warning message:
In .local(x, p, ...) :
1 (0.06%) of the presence points have NA predictor values
Solution seems to be the removal of the spacing between -()Xmx16g -> options(java.parameters = "-Xmx8g")
. This could be a linux thing as I haven't tested it on another OSs.
Also Possible comment to add to the beginning of script: Removal of present variables and restarting Rstudio session is necessary when using options(java.parameters=...) in order to avoid previous package loadspace issues. (see https://stackoverflow.com/questions/34624002/r-error-java-lang-outofmemoryerror-java-heap-space)
06_Ecological_Niche_Modeling_jtmod.txt
sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS
Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/libmkl_rt.so; LAPACK version 3.8.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8 LC_ADDRESS=en_US.UTF-8 LC_TELEPHONE=en_US.UTF-8
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8
time zone: America/Havana
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] kuenm_1.1.10 viridis_0.6.3 viridisLite_0.4.2 ggplot2_3.4.2 ENMeval_2.0.4 magrittr_2.0.3 dismo_1.3-14 dplyr_1.1.2
[9] gtools_3.9.4 raster_3.6-20 sp_1.6-0
loaded via a namespace (and not attached):
[1] gtable_0.3.3 compiler_4.3.0 tidyselect_1.2.0 Rcpp_1.0.10 gridExtra_2.3 scales_1.2.1 fastmap_1.1.1 lattice_0.21-8 R6_2.5.1
[10] generics_0.1.3 knitr_1.42 iterators_1.0.14 tibble_3.2.1 munsell_0.5.0 pillar_1.9.0 rlang_1.1.1 rgdal_1.6-6 utf8_1.2.3
[19] terra_1.7-29 xfun_0.38 cli_3.6.1 withr_2.5.0 digest_0.6.30 foreach_1.5.2 grid_4.3.0 rJava_1.0-6 rstudioapi_0.14
[28] lifecycle_1.0.3 vctrs_0.6.1 evaluate_0.20 glue_1.6.2 codetools_0.2-19 fansi_1.0.4 colorspace_2.1-0 rmarkdown_2.21 purrr_1.0.1
[37] htmltools_0.5.5 tools_4.3.0 pkgconfig_2.0.3