winsorize: Winsorize one vector

Description Usage Arguments Value

View source: R/winsorize.r

Description

Winsorize one vector

Usage

1
winsorize(x, trim = 0.01, na.rm = FALSE)

Arguments

x

Vector to winsorize (numeric)

trim

Fraction of data to trim (if length == 1, same at top and bottom, if length == 2, trim different fractions)

na.rm

Remove NAs? Fails if NAs are present and this argument is FALSE

Value

x, but winsorized

(this version deals with point masses!)


karldw/kdw.junk documentation built on Sept. 8, 2021, 9:30 p.m.