between: Between

Description Usage Arguments Details Value Examples

Description

Determine if a numeric value is within a range

Usage

1
2
3
x %btwn% range

between(x, range, inclusive = TRUE)

Arguments

x

Numeric value or vector to check

range

Numeric vector of two elements, defining the range to check

inclusive

Logical indicating whether or not to include the lower and upper values of the range [Default = TRUE]

Details

x %btwn% range is equivalent to beween(x, range, inclusive = TRUE)

Value

a logical vector of the same length as x. For every element in x returns TRUE if the value lies between the range and FALSE if not.

Examples

1
2
3
4
5 %btwn% c(1, 10)
c(5, 20) %btwn% c(5, 10)
between(5, c(5, 10))
between(5, c(5, 10), inclusive = FALSE)

anilchalisey/juggleR documentation built on May 9, 2019, 4 a.m.