inrange: In Range

Description Usage Arguments Value Examples

View source: R/inrange.R

Description

Test to see if value falls within specified range.

Usage

1
inrange(x, r, open = TRUE)

Arguments

x

A numeric vector of values to be tested.

r

A numeric vector of length 2 specifying the range.

open

A logical scalar indicating if the range interval is open (excludes endpoints, TRUE, default) or closed (includes endpoints, FALSE).

Value

A logical vector, the same length as x indicating if values fall within the specified range.

Examples

1
2
inrange(4:6, c(4, 5.5))
inrange(4:6, c(4, 5.5), FALSE)

JVAdams/jvamisc documentation built on Aug. 11, 2021, 6:43 a.m.