capValues.Rd
capValues
takes a numeric vector and returns a vector in which all
values greater than a specified maximum are reset to that maximum
value.
capValues(DataCol, maxVal = 0.95)
A vector of numeric values where no value is greater than the
maximum specified by maxVal
.
The maximum may be specified either as a quantile or as a number.
If maxVal
is less than one, it is
interpreted as a quantile, otherwise it is interpreted as the maximum
value to return.
The default value is 0.95
, which caps all
values in the input at the 95 percent quantile.
x = seq(1,10) y <- capValues(x, 0.75) z <- capValues(x, 5) rbind(x, y, z)