R/match.R

# Author: Robert J. Hijmans
# Date : October 2011
# October 2011
# version 1
# Licence GPL v3

	

setMethod("%in%", signature(x='Raster', table='ANY'),
	function(x, table) {
		calc(x, function(x) x %in% table)
	}
)

if (!isGeneric("match")) {
	setGeneric("match", function(x, table, nomatch=NA_integer_, incomparables=NULL)
		standardGeneric("match"))
}	


setMethod("match", signature(x='Raster', table='ANY', nomatch='ANY', incomparables='ANY'),
	function(x, table, nomatch, incomparables) {
		calc(x, function(x) match(x, table, nomatch, incomparables))
	}
)

Try the raster package in your browser

Any scripts or data that you put into this service are public.

raster documentation built on Jan. 5, 2021, 3:01 a.m.