is_between: Check whether numbers are between two other numbers.

View source: R/simple_math.R

is_betweenR Documentation

Check whether numbers are between two other numbers.

Description

Returns a logical vector of the same length as x. Can use inclusive or exclusive limits.

Usage

is_between(x, a, b, include_lower = TRUE, include_upper = TRUE)

Arguments

x

(numeric vector) A vector of values to test.

a

(numeric scalar) The lower limit.

b

(numeric scalar) The upper limit.

include_lower

(boolean) Whether to include the lower limit itself. Defaults to TRUE.

include_upper

(boolean) Whether to include the upper limit itself. Defaults to TRUE.

Examples

is_between(1:10, 3, 6)

Deleetdk/kirkegaard documentation built on April 22, 2024, 5:22 p.m.