powered by
Compute quantiles for each cell across the layers of a SpatRaster
# S4 method for SpatRaster quantile(x, probs=seq(0, 1, 0.25), na.rm=FALSE, filename="", overwrite=FALSE, wopt=list(), ...)
SpatRaster
numeric vector of probabilities with values in [0,1]
logical. If TRUE, NA's are removed from x before the quantiles are computed
TRUE
NA
x
character. Output filename. Optional
logical. If TRUE, filename is overwritten
filename
list. Options for writing files as in writeRaster
writeRaster
additional arguments, none implemented
A vector of quantiles
app, local
app
local
# NOT RUN { r <- rast(system.file("exdata/logo.tif", package="terra")) r <- c(r/2, r, r*2) q <- quantile(r) q # same as (but faster than) # qa <- app(r, quantile) # }
Run the code above in your browser using DataLab