1
While performing the Aggregate function to reduce the resolution of a raster file I am getting the error below,
Error in setValues(out, .Call("_raster_aggregate_fun", x, dims, as.integer(na.rm), : std::bad_alloc.
The command used was,
DEM2 <- aggregate(DEM, fact=2, fun=mean, expand=FALSE, na.rm=TRUE)
How to solve this ?
the version I’m using is the R-3.4.3 installed on Opensuse Leap 42.3 64bits, on a laptop with i5 core processor and 8GB RAM.
Are you using Windows? Rstudio? How large is the object (
object.size(dados)
)?This error seems to be associated with the memory allocation of very large files. Edit your question with parts of the datadput(head(dados))
so that we can test if your code is correct.– Willian Vieira
this coming from a comic the variable DEM, used attach()?
– alxwca