Clamp a value to a specified range.

Description

Returns a vector of elements clamped to the specified minimum and maximum

Usage

1

Arguments

val

A value to clamp.

range

A vector of length 2 in the form c(min, max)

Value

A single value that is either unchanged or clamped upward to minimum or clamped downward to the maximum

Examples

1
MovetoRange(11, c(1,10))

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.