Learn R Programming

raster (version 2.5-8)

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

# S4 method for RasterLayer,missing
unique(x, incomparables=FALSE, ...) 

# S4 method for 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
# 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