rBinarise: Binarise the values in a raster

Description Usage Arguments Details Value See Also Examples

View source: R/modify.operators.R

Description

Transform a raster to binary form.

Usage

1
rBinarise(obj, thresh = NULL, match = NULL)

Arguments

obj

[RasterLayer(1)]
The object to modify.

thresh

[integerish(1)]
Value above which the cell will be set to 1, below which it will be set to 0.

match

[integerish(.)]
One or more values which will be set to 1, while the remaining values will be set to 0.

Details

A binary object contains only values 1 (foreground) and 0 (background).

Value

A binary RasterLayer of the same dimension as obj.

See Also

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

Examples

1
2
3
4
input <- rtData$continuous
visualise(rBinarise(input, thresh = 30))

visualise(rBinarise(input, match = 1), new = TRUE)

EhrmannS/rasterTools documentation built on Feb. 4, 2019, 11:22 a.m.