clamp | R Documentation |
This function returns its input, with all values beyond a threshold set to a specified value (default 0).
clamp(x, bias = 0, value = 0, logic = `<`)
x |
A numeric object. |
bias |
A hyperparameter that can be used to adjust x. |
value |
The value to set (clamp) other values to. |
logic |
A logical function that returns which in x should be clamped. |
Returns an object formatted identical to x
Avery Kruger
x <- matrix(rnorm(16,500,TRUE),4,4)
clamp(x)
clamp(x, logic = `>`)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.