clamp: Constrain a numeric value within a range.

View source: R/utils.R

clampR Documentation

Constrain a numeric value within a range.

Description

Constrain a numeric value within a range.

Usage

clamp(value, min.value, max.value)

Arguments

value

Value to constrain.

min.value

Minimum, inclusive.

max.value

Maximum, inclusive.

Value

The closest number in the range [min.value,max.value] to value.


Ergative/logisticat documentation built on May 17, 2022, 12:32 a.m.