Skip to contents

Constructs a discretized gradient along time/height. The gradient value between bounds[i] and bounds[i+1] (not including) is vals[i], values above/below the largest/smallest value of bounds are assigned outval. Helper function for usage with discrete_niche

Usage

discrete_gradient(vals, bounds, outval = "")

Arguments

vals

vector, values of the gradient

bounds

vector of strictly increasing values, e.g. times or stratigraphic heights.

outval

value, gradient value assigned outside of values covered by bounds

Value

a functions assigning continuous values (e.g., times or heights) discrete niches

See also

Examples

# see examples in `discrete_niche` for a use case
# and examples in `apply_niche` for the general application to different data types
# or the vignette on event data for more context