grapes-between-grapes: Test if numbers are within a specified range

Description Usage Arguments Value

Description

Test if a vector of numbers is inside of a specified range, with the bounds optionally included.

Usage

1
2
3
x %between% y

`%between%`(x, y, inc_bounds=TRUE)

Arguments

x

numeric vector to be tested.

rng

vector of minimum and maximum values of the range. Elements beyond the first 2 are ignored.

inc_bounds

logical, whether to include the bounds in the set that is tested. If set to TRUE, values identical to the bounds are considered matches. Defaults to FALSE. Works only if the function is not used as an infix operator (see usage example below).

Value

a logical vector with one element for each element in x


mjdufort/miscHelpers documentation built on Nov. 18, 2018, 9:20 p.m.