clamp: Clamps all elements in 'x' into the range '[min,max]'

View source: R/clamp.R

clampR Documentation

Clamps all elements in 'x' into the range '[min,max]'

Description

same functionality as torch.clamp

Usage

clamp(x, min = 0, max = 1)

Arguments

x

numeric vector

min

minimum value allowed in the returned vector

max

maximum value allowed in the returned vector

Value

vector like x in the range '[min,max]'

Examples

clamp(seq(-1,2, by=0.25))

stackcon/rngt documentation built on June 17, 2022, 5:29 p.m.