raster (version 2.1-41)

unique: Unique values

Description

This function returns the unique values in a RasterLayer, or the unique combinations of values in a multi-layer raster object.

Usage

## S3 method for class 'RasterLayer,missing':
unique(x, incomparables=FALSE, ...) 

## S3 method for class 'RasterStackBrick,missing':
unique(x, incomparables=FALSE, ...)

Arguments

x
Raster object
incomparables
ignored. Must be missing
...
additional arguments. One implemented: progress, as in writeRaster

Value

  • vector or matrix

See Also

unique

Examples

Run this code
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