Learn R Programming

usefun (version 0.5.2)

is_between: Is value between two others?

Description

This function checks if a given value is inside an interval specified by two boundary values.

Usage

is_between(value, low.thres, high.thres, include.high.value = FALSE)

Value

a logical specifying if the value is inside the interval [low.thres,high.thres) (default behaviour) or inside the interval [low.thres,high.thres] if include.high.value is TRUE.

Arguments

value

numeric

low.thres

numeric. Lower boundary of the interval.

high.thres

numeric. Upper boundary of the interval.

include.high.value

logical. Whether the upper bound is included in the interval or not. Default value: FALSE.

Examples

Run this code
is_between(3,2,4)
is_between(4,2,4)
is_between(4,2,4,include.high.value=TRUE)

Run the code above in your browser using DataLab