check_monotonic_increase: Check that values in matrix-like object are (strictly)...

View source: R/mathematical_functions.R

check_monotonic_increaseR Documentation

Check that values in matrix-like object are (strictly) monotonically increasing/decreasing

Description

Check that values in matrix-like object are (strictly) monotonically increasing/decreasing

Usage

check_monotonic_increase(
  x,
  MARGIN = 1L,
  increase = TRUE,
  strictly = FALSE,
  fail = FALSE,
  replacement = NA,
  na.rm = FALSE
)

Arguments

x

A numeric matrix like object.

MARGIN

An integer value giving the subscripts over which the monotonicity will be checked; 1 indicates rows, 2 indicates columns.

increase

A logical value. If TRUE, check monotonic increase; if FALSE, check monotonic decrease.

strictly

A logical value. If TRUE, check for a strict monotonic pattern.

fail

A logical value. If TRUE, throw error if monotonic check fails.

replacement

A value that replaces non-(strictly) monotonically increasing/decreasing values if fail is FALSE.

na.rm

A logical value. If TRUE, then ignore NAs; if FALSE, then fail if strictly or replace with replacement.

Value

The updated x.


DrylandEcology/rSW2utils documentation built on Dec. 9, 2023, 10:44 p.m.