replace: Replace values of a SpatRaster

Description Value See Also Examples

Description

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

Value

SpatRaster

See Also

values, replace

Examples

1
2
3
4
5
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

terra documentation built on Oct. 11, 2021, 9:09 a.m.