isBetween: isBetween

View source: R/helpers.R

isBetweenR Documentation

isBetween

Description

Assess if x is between left and right bounds. Shortcut for x >= left & x <= right if strict=FALSE (default). Shortcut for x > left & x < right if strict=TRUE.

Usage

isBetween(x, left, right, strict = FALSE)

Arguments

x

Numeric values to assess

left

Numeric value(s) used as lower bound

right

Numeric value(s) used as upper bound

strict

Logical value defining if x is strictly between left and right. Default value is FALSE.

Value

Logical values

Examples

isBetween(1:12, 7, 9)

x <- rnorm(1e2)
x[isBetween(x, -1, 1)]

isBetween(x, cos(x) + 1, cos(x) - 1)

Open-Systems-Pharmacology/TLF-Library documentation built on Feb. 8, 2025, 11:22 a.m.