monotonic_check: Check if a vector is monotonically increasing/decreasing

View source: R/math_funcs.R

monotonic_checkR Documentation

Check if a vector is monotonically increasing/decreasing

Description

Check if a vector is monotonically increasing/decreasing

Usage

monotonic_check(v, direction = "increasing")

Arguments

v

Numeric vector

direction

String, either "increasing" or "decreasing"

Value

TRUE/FALSE

Examples

v1 <- sample(1:100,size=10)
v2 <- 1:10
monotonic_check(v1)
monotonic_check(v2)
monotonic_check(v2, direction="decreasing")


BIO-RSG/oceancolouR documentation built on Feb. 2, 2025, 2:01 a.m.