Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

clamp

Clamp a value into a range


Description

Splits paths into folders.

Usage

clamp(x, e1, e2 = -e1)

Arguments

x

vector

e1

the first edge

e2

the other edge, defaults to the negation of e1.

Value

x, with values outside the boundaries replaced with the boundary points.

Author(s)

References

Examples

clamp(-10:10, 2, -2)
clamp(-10:10, -2)
clamp(-10:10, 2)

stackoverflow

Stack Overflow's Greatest Hits

v0.7.0
CC BY-SA 4.0
Authors
Neal Fultz <nfultz@gmail.com> and the StackOverflow.com community
Initial release
2020-01-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.