View source: R/misc_functions.R
clamp | R Documentation |
'clamp' limits the values in a numeric vector 'x' so that all elements are constrained within the interval [a, b]. It dispatches to either 'fclamp' for double precision values or 'fclamp_int' for integer values.
clamp(x, a = 0, b = 1, inplace = FALSE)
x |
A numeric vector of values to be clamped. |
a |
A numeric value specifying the lower bound (default: 0). |
b |
A numeric value specifying the upper bound (default: 1). |
inplace |
Logical. If TRUE, the clamping operation is performed in-place; otherwise, a new vector is returned. |
A numeric vector with values clamped to the interval [a, b].
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.