within_range: Function to test if a vector is within one, or many ranges.

View source: R/within_range.R

within_rangeR Documentation

Function to test if a vector is within one, or many ranges.

Description

within_range works well for testing Unix time too.

Usage

within_range(x, start, end)

Arguments

x

Numeric vector to test.

start

Start of range.

end

End of range.

Value

Logical vector of length of x.

Author(s)

Stuart K. Grange

See Also

which

Examples


# Test a single range
within_range(1:10, 8, 9)

# Test many ranges
within_range(1:100, c(1, 5), c(2, 9))
 

skgrange/threadr documentation built on May 11, 2024, 12:16 p.m.