winsorNorm: winsorNorm

Description Usage Arguments Value Examples

View source: R/global_processing.R

Description

Normalize a numeric vector by rescaling and Winsorizing, i.e. rescale the middle of the data to the range [0, 1] and bound the upper tail to 1 and the lower tail to 0, effectively replacing a fixed amount of extreme values in each tail. Similar to trimming the tails except instead of discarding the tails entirely they're bounded.

Usage

1
winsorNorm(x, trim)

Arguments

x

A numeric vector, the data to be normalized

trim

Numeric, a fraction in [0, 1] specifying how much of the data to bound to 0 (for the lower tail) or 1 (for the upper tail)

Value

Numeric vector

Examples

1
2
3
4
5
x <- seq(1, 100, by = 1)
x

# Bound the lower and upper 5% of values in the vector
winsorNorm(x, trim = 0.05)

chromswitch documentation built on Nov. 8, 2020, 5:24 p.m.