winsorNorm {chromswitch} | R Documentation

## winsorNorm

### 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

    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

    x <- seq(1, 100, by = 1)
    x

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

[Package chromswitch version 1.9.2 Index]