Bound the values of x
to lie within the upper and lower
bounds.
minmax(x, lower, upper)
x | vector of values to limit |
---|---|
lower, upper | lower and upper limits |
vector of the same length as x
#> [1] 41 -33 66 28 61 -58 -87 86 -50 -16 -80 5 81 -27 -94 -28 -22 -64 4 #> [20] 9minmax(c, -10, 10)#> [1] 10 -10 10 10 10 -10 -10 10 -10 -10 -10 5 10 -10 -10 -10 -10 -10 4 #> [20] 9