Skip to contents

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)
#> [1] FALSE
is.decreasing(doy1)
#> [1] FALSE

is.increasing(doy2)
#> [1] TRUE
is.decreasing(doy2)
#> [1] FALSE

is.increasing(doy3)
#> [1] FALSE
is.decreasing(doy3)
#> [1] TRUE