0

I did use the function crop and mean for 434 rasters in Rstudio. Each one is very big, it corresponds almost like 1/4 of Brazil.

Now I want to calculate the standard deviation between these 434 rasters images but this error appears.

I have 66gb of space but it seems that my computer will not process

sd_ndvi_caat_crop<-calc(ndvi_caat_crop, sd, na.rm=TRUE, aszero=FALSE)
**Error: cannot allocate vector of size 31.6 Gb**

What should I do?

Or if I use the function cellStats does it calculate in the same way? Like calculating the sd of each cell of each 434 rasters images?

  • Welcome to GIS.SE. I am somehow expecting an error message in your post, yet there seems to be none. Could you add it, please? – Erik Jan 28 at 15:29
  • Sorry. sd_ndvi_caat_crop<-calc(ndvi_caat_crop, sd, na.rm=TRUE, aszero=FALSE)#desvio padrao raster# Error: cannot allocate vector of size 31.6 Gb – Fernanda Lamin Henrique Jan 28 at 15:31
  • "Very big" is not very precise - can you list the number of rows, columns, and layers for your objects? Is ndvi_caat_crop a stack of 434 rasters? I think you might have to divide the stack into chunks and compute the SD raster by parts unless you can get another 64Gb of RAM. – Spacedman Jan 28 at 17:07
  • class : RasterBrick dimensions : 7220, 5421, 39139620, 434 (nrow, ncol, ncell, nlayers) resolution : 272.4573, 272.4414 (x, y) extent : -4580684, -3103693, -2334112, -367085 (xmin, xmax, ymin, ymax) – Fernanda Lamin Henrique Jan 31 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.