is_continuous: Check for continuity

View source: R/norming.R

is_continuousR Documentation

Check for continuity

Description

Check if a vector represents a continuous sequence of integer values between the minumum and the maximum, sorted in ascending or descending order.

Usage

is_continuous(x, direction = c("both", "forward", "backward"), na.rm = TRUE)

Arguments

x

Numeric vector.

direction

Character value indicating if check the values in ascending order (forward), in descending order (backward), or in both orders.

na.rm

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

Details

Pay attantion that the monotonicity is required. In this sense, is_continuous is stronger than is_monotonic.

See Also

is_monotonic

Examples

x <- c(1, 2, 3, 5)
is_continuous(x)
is_monotonic(x)
x <- c(4, 3, 2, 1)
is_continuous(x)
is_monotonic(x)

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