Learn R Programming

difNLR (version 1.3.7)

checkInterval: Checks interval bounds.

Description

Checks whether x lies in interval defined by bounds in vec. If it does, it returns value of x. In case that value of x is lower than lower bound specified in vec, it returns its value. In case that value of x is greater than upper bound specified in vec, it returns its value.

Usage

checkInterval(x, vec)

Arguments

x

numeric.

vec

numeric: increasingly sorted bounds of interval.

Examples

Run this code
# NOT RUN {
checkInterval(x = 0.5, vec = c(0, 1))
checkInterval(x = 1.5, vec = c(0, 1))
checkInterval(x = -0.5, vec = c(0, 1))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab