I am using spatstat to estimate the risk of pest introduction and spread from roads, highways, and other roadways. However, I believe I am running into memory-limitation issues; my data is at a continental scale and my computer only has 16 GB of memory. The warning message I receive when running spatstat's as.owin()
and density.psp()
functions is:
Error: cannot allocate vector of size X.X. Gb
Some colleagues of mine have suggested I might be able to lessen the memory-burden by converting the spatstat functions as.owin()
and density.psp()
to execute via C++ with the rcpp package. This technique is well outside of my comfort zone and I was hoping to get a sense from StackOverflow on whether or not it's even feasible before I dedicate many hours to it.
Specifically, my questions are:
- Has anyone converted spatstat functions to C++?
- How have other spatstat users worked around memory-limitation issues?
Any help and guidance would be greatly appreciated.
Many thanks,
Josh