Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

quantile

SpatRaster local quantiles


Description

Compute quantiles for each cell across the layers of a SpatRaster

Usage

## S4 method for signature 'SpatRaster'
quantile(x, probs=seq(0, 1, 0.25), na.rm=FALSE, filename="", ...)

Arguments

x

SpatRaster

probs

numeric vector of probabilities with values in [0,1]

na.rm

logical. If TRUE, NA's are removed from x before the quantiles are computed

filename

character. Output filename

...

additional arguments for writing files as in writeRaster

Value

SpatRaster with layers representing quantiles

See Also

Examples

r <- rast(system.file("ex/logo.tif", package="terra"))   
r <- c(r/2, r, r*2)
q <- quantile(r)
q

# same but slower
# qa <- app(r, quantile)

terra

Spatial Data Analysis

v1.2-10
GPL (>= 3)
Authors
Robert J. Hijmans [cre, aut] (<https://orcid.org/0000-0001-5872-2872>), Roger Bivand [ctb] (<https://orcid.org/0000-0003-2392-6140>), Karl Forner [ctb], Jeroen Ooms [ctb] (<https://orcid.org/0000-0002-4035-0289>), Edzer Pebesma [ctb] (<https://orcid.org/0000-0001-8049-7069>)
Initial release
2021-05-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.