Replaces outliers in a continuous variable.

Description

Given a vector of integer or numeric values, outliers exceeding user-defined limits are replaced.

Usage

1
2
## S3 method for class 'numeric'
ReplaceOutliers(this, lowerLimit=NULL, upperLimit=NULL, ...)

Arguments

this

An array of numeric values. Missing values will be ignored and retained.

lowerLimit

If a value is provided then values less than this in this will be replaced with the value of lowerLimit.

upperLimit

If a value is provided then values greater than this in this will be replaced with the value of upperLimit.

...

Extra unused arguments.

Details

A new array is returned with outliers replaced with limit values. Any value that is less than lowerLimit or greater than upperLimit is considered an outlier. Missing values are ignored.

Value

An array with outliers replaced.

Author(s)

Justin Hemann <support@causata.com>

Examples

1
ReplaceOutliers(c(-1000, 1, 2, 3, NA, 1000), lowerLimit=1, upperLimit=3)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.