Skip to contents

Takes a vector, identifies a given percentage of outliers on each side, and moves them to the floor or the ceiling respectively.

Usage

outlier.floor.and.ceil(x, trim);

Arguments

x

Vector of numbers to analyze

trim

The percentage of values to floor/ceil on each side (i.e. total number changed is twice this value)

Value

The modified vector

Author

Paul C. Boutros

Examples

x <- c(-100, rnorm(18), 100);
y <- outlier.floor.and.ceil(x = x, trim = 0.05);
plot(x, y, pch = 19, las = 1);