When I run the aggregate function to reduce the resolution of a raster file I'm 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 am using is R-3.4.3 installed on OpenSUSE Leap 42.3 64Bits, on a laptop with an i5 core processor and 8GB of RAM.