get_percentile_map: get_percentile_map

Description Usage Arguments Value Examples

View source: R/get_percentile_map.R

Description

This function calculates percentile(s) at each grid point. Wrappers raster::calc.

Usage

1

Arguments

r

Raster* object (either RasterStack or RasterBrick). This could be the full record of daily indices or daily climatology.

probs

numeric vector of probabilities with values in the range [0, 1] listing which percentiles should be calculated.

Value

list containing all the generated percentile maps

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
 # Generate dummy RasterLayer
 r <- raster(nrows = 2, ncols = 2, xmn = 0, xmx = 360, ymn = -90, ymx = 90, vals = 30)
 # Generate dummy RasterBrick
 b <- raster::brick(lapply(1:(365 * 3),
                    function(i) raster::setValues(r,
                      runif(n = raster::ncell(r), min = 0, max = 100))))
 # Get percentile maps
 get_percentile_map(b, probs = c(0.50, 0.75, 0.90, 0.99))

## End(Not run)

caliver documentation built on Feb. 19, 2021, 5:07 p.m.