This function returns the unique values in a RasterLayer, or the unique combinations of values in a multi-layer raster object.
# S4 method for RasterLayer,missing
unique(x, incomparables=FALSE, ...) # S4 method for RasterStackBrick,missing
unique(x, incomparables=FALSE, ...)
Raster object
ignored. Must be missing
additional arguments. One implemented: progress
, as in writeRaster
vector or matrix
# NOT RUN {
r <- raster(ncol=10, nrow=10)
r[] <- round(runif(ncell(r))*10)
unique(r)
unique(stack(r, round(r/2)))
# }
Run the code above in your browser using DataLab