R: Unique values

unique {raster} | R Documentation

## 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 signature 'RasterLayer,missing'
    unique(x, incomparables=FALSE, ...)

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

    r <- raster(ncol=10, nrow=10)
    r[] <- round(runif(ncell(r))*10)
    unique(r)
    unique(stack(r, round(r/2)))

[Package raster version 2.5-8 Index]