out_winsorise: Winsorize

Description Usage Arguments Value See Also Examples

View source: R/04-outliers.R

Description

Maturing lifecycle

Replace extremely values that are defined by min and max.

Usage

1
2
3
out_winsorise(x, min = quantile(x, 0.05), max = quantile(x, 0.95))

out_winsorize(x, min = quantile(x, 0.05), max = quantile(x, 0.95))

Arguments

x

[univariate vector]

Univariate vector, numeric or ts object with only one dimension.

min

[numeric(1): quantile(x, 0.05)]

The lower bound, all values lower than this will be replaced by this value.

max

[numeric(1): quantile(x, 0.95)]

The upper bound, all values above than this will be replaced by this value.

Value

Returns a vector with the same class and attributes as the input vector.

See Also

Winsorize

Examples

1
2
x <- c(1, 3, -1, 5, 10, 100)
out_winsorise(x)

kvasilopoulos/transx documentation built on Jan. 26, 2021, 6:14 p.m.