is_monotonic: Check for monotony

View source: R/norming.R

is_monotonicR Documentation

Check for monotony

Description

Check if the values in a vector are a monotonic sequence.

Usage

is_monotonic(x, direction = c("both","forward","backward"),
    decreasing = NULL, na.rm = TRUE)

Arguments

x

Numeric vector.

direction

Character value indicating if check the monotonic trend only for a particular direction.

decreasing

Deprecated. Use direction instead.

na.rm

Logical value specifying if remove missing data before run the procedure.

Details

da descrivere

See Also

isoreg, is_continuous

Examples

x1 <- c(1.3, 2.2, 3.8, 3.3, 5.6, 6.1, 8.0, 8.0, 8.9, 9.9)
is_monotonic(x1)
x2 <- x1
# Smoothing of x1
x2[3:4] <- mean(x2[3:4])
is_monotonic(x2)

DavideMassidda/testing documentation built on Oct. 12, 2023, 4:32 p.m.