R - Chaging specific cell values in a large raster layer
I am working with R "raster" package and have a large raster layer (62460098 cells, 12 Mb for the object). My cell values range from -1 to 1. I have to replace all negative values with a 0 (example: a cell that has -1 as value has to become a 0). I tried to do this: raster[raster < 0] <- 0 But it keeps overloading my RAM because of the raster size. OS: Windows 7 64-bits RAM size: 8GB Tks! You can do r <- reclassify(raster, c(-Inf, 0, 0)) This will work on rasters of any size (no memory limitation) 42- There are several postings that discuss memory issue s and it's not clear if you have