Winsorise either by number or percentage of observations.
Usage
wins(x, p = 0.05)
colWins(x, p = 0.05)
rowWins(x, p = 0.05)
Value
Winsorised vector.
Arguments
x
input data. NAs will be removed.
p
percentage or number of observations to be winsorised. If value is <1 then it is used as a percentages. Otherwise it is the number of observations to winsorise. If the resulting p > floor((length(x)-1)/2), then it is set equal to floor((length(x)-1)/2).