descasc: Check is numbers in a vector are decreasing or increasing

is.increasingR Documentation

Check is numbers in a vector are decreasing or increasing

Description

Test if numeric values of a vector are decreasing or increasing using the radix method

Usage

is.increasing(., na.last = TRUE)

is.decreasing(., na.last = TRUE)

Arguments

.

a numeric vector

na.last

for controlling the treatment of NAs. If TRUE, missing values in the data are put last; if FALSE, they are put first; if NA, they are removed.

Value

boolean value to indicate if the values are increasing or decreasing

Examples

# example code
doy1 <- rnorm(1e3)
doy2 <- sort(doy1, decreasing = FALSE)
doy3 <- sort(doy1, decreasing = TRUE)

is.increasing(doy1)
is.decreasing(doy1)

is.increasing(doy2)
is.decreasing(doy2)

is.increasing(doy3)
is.decreasing(doy3)

quickcode documentation built on April 11, 2025, 5:49 p.m.