grapes-btw-grapes: Operator to see if value between values of vector

Description Usage Arguments Examples

Description

Custom operator that takes a single value or a numeric vector and returns TRUE if values between minimum and maximum of a given vector.

Usage

1
2
3
x %btw% vec

x %sbtw% vec

Arguments

x

a numeric value or vector

vec

a numeric vector

Examples

1
2
3
4
5
6
my_vec <- c(1, 4, 8)

1 %btw% my_vec  # returns TRUE
1.3 %btw% my_vec  # returns TRUE
0 %btw% my_vec  # returns FALSE
c(0,1.3,8, 12) %sbtw% my_vec # returns FALSE TRUE FALSE FALSE

Rekyt/divr documentation built on April 1, 2020, 5:35 a.m.