R: Replace values of a SpatRaster

replace {terra} | R Documentation

## Replace values of a SpatRaster

### Description

Replace values of a SpatRaster. These are convenience functions for smaller objects only.

### Value

SpatRaster

### See Also

values, replace

### Examples

    r <- rast(ncols=5, nrows=5, xmin=0, xmax=5, ymin=0, ymax=5)
    r[] <- 1:25
    r[1,] <- 5
    r[,2] <- 10
    r[r>10] <- NA

[Package terra version 1.3-22 Index]