Last chance! 50% off unlimited learning
Sale ends in
This function returns the unique values in a RasterLayer object or the unique combinations of the layers in a multilayer object.
# S4 method for RasterLayer,missing
unique(x, incomparables=FALSE, na.last=NA, progress="", ...) # S4 method for RasterStackBrick,missing
unique(x, incomparables=FALSE, na.last=NA, progress="", ...)
vector or matrix
Raster object
must be missing. The default value FALSE
is used. See unique
logical. for controlling the treatment of NA
s. If TRUE
, missing values in the data are put last; if FALSE
, they are put first; if NA
, they are removed.
character. Use "text" or "window" for a progress indicator
additional arguments. as in unique
r <- raster(ncol=10, nrow=10)
values(r) <- round(runif(ncell(r))*10)
unique(r)
unique(stack(r, round(r/2)))
Run the code above in your browser using DataLab