within: Detect if numeric values fall within range of a vector

View source: R/validate_mnirs.R

withinR Documentation

Detect if numeric values fall within range of a vector

Description

Vectorised check for x %in% vec, inclusive or exclusive of left and right boundary values, specified independently.

Usage

within(x, vec, inclusive = c("left", "right"))

Arguments

x

A numeric vector.

vec

A numeric vector from which left and right boundary values for x will be taken.

inclusive

A character vector to specify which of left and/or right boundary values should be included in the range, or both (the default), or excluded if FALSE.

Details

inclusive = FALSE can be used to test for positive non-zero values: within(x, c(0, Inf), inclusive = FALSE).

Value

A logical vector the same length as x.

See Also

dplyr::between()


mnirs documentation built on May 15, 2026, 9:07 a.m.