# NOT RUN {
r <- rast(system.file("ex/logo.tif", package="terra"))
rr <- c(r/2, r, r*2)
qr <- quantile(rr)
qr
# }
# NOT RUN {
# same but slower
qa <- app(rr, quantile)
# }
# NOT RUN {
#quantile by layer instead of by cell
qg <- global(r, quantile)
# }
Run the code above in your browser using DataLab