quantile: Raster quantiles

Description Usage Arguments Value See Also Examples

Description

Compute quantiles for the cell values of a RasterLayer. If you want to compute quantiles for each cell across a number of layers, you can use calc(x, fun=quantile).

Usage

1

Arguments

x

Raster object

...

Additional arguments: na.rm=TRUE, ncells=NULL, and additional arguments to the stats::quantile function, see quantile

ncells can be used to set the number of cells to be sampled, for very large raster datasets.

Value

A vector of quantiles

See Also

density, cellStats

Examples

1
2
3
4
r <- raster(ncol=100, nrow=100)
values(r) <- rnorm(ncell(r), 0, 50)
quantile(r)
quantile(r, probs = c(0.25, 0.75), type=7,names = FALSE)

Example output

Loading required package: sp
         0%         25%         50%         75%        100% 
-179.041343  -33.531995   -1.076153   32.660867  190.988672 
[1] -33.53199  32.66087

raster documentation built on Jan. 5, 2021, 3:01 a.m.