Replace extreme values by absolute or quantile threshold
Usage
winsorize(
x,
lo = NULL,
hi = NULL,
prob_lo = 0.025,
prob_hi = 0.975,
quantile_type = 7,
verbosity = 1L
)
Arguments
- x
Numeric vector: Input data
- lo
Numeric: If not NULL, replace any values in
x
lower than this with this.- hi
Numeric: If not NULL, replace any values in
x
higher than this with this.- prob_lo
Numeric (0, 1): If not NULL and
lo = NULL
, find sample quantile that corresponds to this probability and set aslo
.- prob_hi
Numeric (0, 1): If not NULL and
hi = NULL
, find sample quantile that corresponds to this probability and set ashi
.- quantile_type
Integer: passed to
stats::quantile
- verbosity
Integer: Verbosity level.