How to replace NA's in a raster object

前端 未结 2 611
梦毁少年i
梦毁少年i 2021-02-05 14:53

I need to replace the NA\'s in the raster object (r) from the example below.

library(raster)
filename <- system.file(\"external/test         


        
2条回答
  •  旧时难觅i
    2021-02-05 15:21

    A more memory safe approach (for large files) would be to use reclassify:

    library(raster)
    filename <- system.file("external/test.grd", package="raster")
    r <- raster(filename)
    rna <- reclassify(r, cbind(NA, 250))
    

提交回复
热议问题