clamp: Clamp a value to a range

View source: R/helpers.R

clampR Documentation

Clamp a value to a range

Description

Clamp a value to a range

Usage

clamp(x, lower = -Inf, upper = Inf)

Arguments

x

(numeric()) A numeric value to be clamped.

lower

('numeric(1)') The lower bound of the range.

upper

(numeric(1)) The upper bound of the range.

Value

A numeric value clamped to the range [lower, upper].


SerolyzeR documentation built on April 12, 2025, 2:11 a.m.