This function is used to derive local spread rate from a first-date-of-invasion surface

invslope(x, rmtop, bnd)

Arguments

x

Raster* with estimated first-arrival date. Needs to be projected.

rmtop

Numeric, between 0 and 100. Discard the rmtop top percent of values.

bnd

Numeric vector of length 2. Expected range of values. Everything beyond this range is filtered.

Value

An object of the same class Raster* as the input.

Details

To control for spurious numerical divergences, the user can remove the largest rmtop values beyond a reasonable interval bnd.

Examples

## A flat surface with constant slope of 1 r_values <- replicate(100, seq(0.01, 1, length = 100)) r <- raster(r_values, crs = sp::CRS("+init=epsg:3857")) plot(r)
invslope(r)
#> class : RasterLayer #> dimensions : 100, 100, 10000 (nrow, ncol, ncell) #> resolution : 0.01, 0.01 (x, y) #> extent : 0, 1, 0, 1 (xmin, xmax, ymin, ymax) #> crs : +init=epsg:3857 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs #> source : memory #> names : est_fasr.1 #> values : 1, 1 (min, max) #>