Learn R Programming

Causata (version 4.2-0)

ReplaceOutliers: Replaces outliers in a continuous variable.

Description

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

Usage

"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.

Value

An array with outliers replaced.

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.

Examples

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

Run the code above in your browser using DataLab