unique: Unique values

Description Usage Arguments Value See Also Examples

Description

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

Usage

1
2
3
4
5
## 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

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

Example output

Loading required package: sp
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
 [1]  0  1  2  3  4  5  6  7  8  9 10
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
      layer.1 layer.2
 [1,]       7       4
 [2,]       8       4
 [3,]       6       3
 [4,]       1       0
 [5,]       4       2
 [6,]       5       2
 [7,]      10       5
 [8,]       3       2
 [9,]       0       0
[10,]       9       4
[11,]       2       1

raster documentation built on Nov. 17, 2017, 5:51 a.m.