Skip to contents

This function checks if a number is within a specified range. This function is vectorized in a way such that either or both lowerbound and upperbound can be length 1 or the same length as the input vector.

Usage

isBound(num, lowerbound, upperbound)

Arguments

num

A numeric vector to be checked.

lowerbound

The lower bound of the range.

upperbound

The upper bound of the range.

Value

A logical vector indicating whether each element is within the specified range.

Examples

isBound(1, 0, 2)
#> [1] TRUE
isBound(1:10, -1, 5)
#>  [1]  TRUE  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE