inbounds: Clip value to a given range

View source: R/utilities.r

inboundsR Documentation

Clip value to a given range

Description

Clip x to the interval [l, u]. This is useful to enforce box constraints.

Usage

inbounds(x, l, u)

Arguments

x

Value to clip.

l

Lower limit.

u

Upper limit.

Value

l if x < l, u if x > u else x.

Author(s)

Olaf Mersmann olafm@statistik.tu-dortmund.de


emoa documentation built on Sept. 11, 2024, 8:57 p.m.