discrete_gradient: construct discretized gradient

View source: R/discrete_gradient.R

discrete_gradientR Documentation

construct discretized gradient

Description

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

  • discrete_niche() to construct niches based on discretized gradients

  • apply_niche() to combine discrete_niche() and discrete_gradient() to model the effects of niches

  • vignette("advanced_functionality") for details how to create user-defined niche models

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


StratPal documentation built on April 3, 2025, 8:54 p.m.