rSubstitute: Substitute values in a raster

Description Usage Arguments Value See Also Examples

View source: R/modify.operators.R

Description

Substitute values in a raster

Usage

1
rSubstitute(obj, old = NULL, new = NULL, col = "#FF55FF")

Arguments

obj

[RasterLayer(1)]
The object to modify.

old

[integerish(.)]
values to be substituted.

new

[integerish(1)]
value to substitute with.

col

[character(1)]
six-digit hex colour code.

Value

A RasterLayer of the same dimensions as obj, in which old values have been replaced by the new value.

See Also

Other operators to modify cell values: rBinarise, rCategorise, rDistance, rFillNA, rOffset, rPermute, rRange

Examples

1
2
3
input <- rtRasters$categorical
substituted <- rSubstitute(input, old = c(41, 44, 47), new = list(id = 40))
visualise(raster::stack(input, substituted))

EhrmannS/rasterTools documentation built on Sept. 4, 2019, 10:34 a.m.