IsBetween: IsBetween Function

Description Usage Arguments Value Author(s) Examples

Description

This function returns TRUE if x is between lb (lower bound) and ub (upper bound). This function can act on any type for which <, <=, >, and >= are defined. This function works nicely with the pipe operator from the dplyr and magrittr packages.

Usage

1
IsBetween(x, lb, ub, equality.ok = FALSE)

Arguments

x

the focal object

lb

lower bound

ub

upper bound

equality.ok

Indicates whether it acceptable for the focal object to be equal to one of the arguments. Defaults to FALSE.

Value

TRUE if x is between lb and ub and FALSE otherwise.

Author(s)

Robert Corty

Examples

1
2
3
4
IsBetween(x = 0, lb = 1, ub = 2)
IsBetween(x = 1, lb = 0, ub = 2)
IsBetween(x = 0, lb = 0, ub = 2)
IsBetween(x = 0, lb = 0, ub = 2, equality.ok = TRUE)

rcorty/CortyKit documentation built on May 27, 2019, 3:03 a.m.