betwixt: Does numeric vector fall in a range

Description Usage Arguments Value Examples

View source: R/truncare.R

Description

This is a shortcut for x > lower & x < upper and variants with equalities. This function is more flexible than between.

Usage

1
2
betwixt(x, left = -Inf, right = Inf, leq = TRUE, geq = TRUE,
  na.rm = TRUE)

Arguments

x

Numeric vector of values

left, right

Boundary values

geq, leq

Use >= (<=) else use > (<) for testing the boundaries.

na.rm

If TRUE return FALSE for NA or NaN

Value

A logical vector that is TRUE if the value falls in the interval.

Examples

1
2
betwixt(-2:4, 0, 3)
betwixt(-2:4, 0, 3, leq = FALSE, geq = FALSE)

jrnold/rubbish documentation built on May 20, 2019, 2:05 a.m.