ursa_match: Raster value matching

ursa_matchR Documentation

Raster value matching

Description

ursa_match creates raster mask, which is corresponded to vector of reference values

Usage


## S3 method for class 'ursaRaster'
mtfrm(x)

ursa_match(obj, value)

Arguments

x, obj

Object of class ursaRaster

value

Vector of reference values, generally, numeric. If obj is categorical, then values can be character for matching to category names.

Details

ursa_match(obj,c("blue","yellow") is equal to obj=="blue" | obj=="yellow"

Value

Object of class ursaRaster as a mask of correspondence to reference values

Author(s)

Nikita Platonov platonov@sev-in.ru

See Also

Comparison `==` in groupGeneric

Examples

session_grid(NULL)
a <- colorize(ursa_dummy(1),name=c("low","medium","high"),stretch="equal")
ta <- as.table(a)
ta
c('category value for "low"'=category_value(a,"low"))
res <- c('match to single char'=ursa_match(a,c("medium"))
        ,'match to multiple num'=ursa_match(a,c(0,category_value(a,"high")))
        ,'match to multiple char'=ursa_match(a,c("low","high"))
        ,'logical OR' = a=="low" | a=="high")
res
c(band_n(res)[1]==ta[2],band_n(res)[3]==sum(ta[c(1,3)]))

ursa documentation built on Dec. 20, 2025, 1:07 a.m.