Learn R Programming

DEXiR (version 1.0.2)

is_in_range: is_in_range

Description

Check whether or not x lies the specified range.

Usage

is_in_range(x, lb, hb, lassoc = c("up", "down"), hassoc = c("down", "up"))

Value

logical(1), indicating whether or not x lies in the interval [lb:hb]

according to function arguments.

Arguments

x

Any object type, but using a non-numeric argument always returns FALSE.

lb

numeric(1). Lower bound of the interval.

hb

numeric(1). Ipper bound of the interval.

lassoc

"up" or "down", indicating whether lb is included in the [lb:hb] interval ("up") or not ("down"). The default is "up".

hassoc

"up" or "down", indicating whether hb is included in the [lb:hb] interval ("down") or not ("up"). The default is "down".

Examples

Run this code
is_in_range(3, 2, 5)
is_in_range(7, 2, 5)
is_in_range(3, 3, 5)
is_in_range(3, 3, 5, lassoc = "down")

Run the code above in your browser using DataLab