Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with import raster package: Unable to load module "spmod"

Tags:

r

raster

r-raster

I have installed R (3.5.1) and R-studio (1.1.456) just now (using Anaconda). Then, I installed the raster package (2.9-5). Everything was okay, but when I tried to import, I got this message:

> library(raster)

Download required package: sp Error: package or namespace load failed for ‘raster’ in .doLoadActions(where, attach): error in load action .__ A __.1 for package raster: loadModule(module = "spmod", what = TRUE, env = ns, loadNow = TRUE): Unable to load module "spmod": cannot allocate vector of size 15759.3 Gb

Edit: The problem actual only windows 10. I tried it on Linux (Ubuntu 18.04) and everything is okay

like image 226
Dmitry Tsybulkin Avatar asked May 22 '19 09:05

Dmitry Tsybulkin


1 Answers

I had the same error, also using Windows 10 (R v 3.6.1 and raster v 3.0-7) and was able to solve it by installing the R package ‘Rcpp’.

edit: You can install the R package 'Rcpp' by typing "install.packages("Rcpp")" into the R console. (for more on installing R packages see the documentation: https://www.rdocumentation.org/packages/utils/versions/3.6.1/topics/install.packages)

like image 134
aputman Avatar answered Oct 06 '22 02:10

aputman