match

0th

Percentile

Value matching for Raster* objects

match returns a Raster* object with the position of the matched values. The cell values are the index of the table argument.

%in% returns a logical Raster* object indicating if the cells values were matched or not.

Keywords
methods, spatial
Usage
match(x, table, nomatch = NA_integer_, incomparables = NULL)

x %in% table

Arguments
x

Raster* object

table

vector of the values to be matched against

nomatch

the value to be returned in the case when no match is found. Note that it is coerced to integer

incomparables

a vector of values that cannot be matched. Any value in x matching a value in this vector is assigned the nomatch value. For historical reasons, FALSE is equivalent to NULL

Value

Raster* obeject

See Also

calc, match

Aliases
  • match
  • match,Raster-method
  • %in%
  • %in%,Raster-method
Examples
# NOT RUN {
r <- raster(nrow=10, ncol=10)
r[] <- 1:100
m <- match(r, c(5:10, 50:55))
n <- r %in% c(5:10, 50:55)
# }
Documentation reproduced from package raster, version 2.9-5, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.