limit the values in x so that each value lies within the closed interval [left, right]

limitToRange(x, left = .Machine$double.eps, right = 1)

Arguments

x

vector of numeric values

left

lower boundary

right

upper boundary

Examples

limitToRange(1:20, left = 5, right = 15)
#> [1] 5 5 5 5 5 6 7 8 9 10 11 12 13 14 15 15 15 15 15 15