powered by
match returns a SpatRaster with the position of the matched values. The cell values are the index of the table argument.
match
%in% returns a 0/1 (FALSE/TRUE) SpatRaster indicating if the cells values were matched or not.
%in%
match(x, table, nomatch = NA_integer_, incomparables = NULL)x %in% table
x %in% table
SpatRaster
app, match
r <- rast(nrows=10, ncols=10) values(r) <- 1:100 m <- match(r, c(5:10, 50:55)) n <- r %in% c(5:10, 50:55)
Run the code above in your browser using DataLab