outlier.remove: remove outliers

View source: R/function.R

outlier.removeR Documentation

remove outliers

Description

This function removes outliers in the data, which are far from the sample median.

Usage

outlier.remove(x, rg = 3)

Arguments

x

a numeric data vector.

rg

a positive number indicating how the outliers are defined; see details.

Details

An outlier is detected if it deviates from the sample median more than rg times interquantile range.

Value

a list containing the following:

x

a new data vector with outliers replaced with NA. The original missing values in the data are preserved.

id

the locations of the outliers in the data vector.

Author(s)

Yong He, Xinbing Kong, Lorenzo Trapani, Long Yu

Examples


a=c(1:5,NA,10000)
outlier.remove(a,3)

OLCPM documentation built on June 22, 2024, 9:26 a.m.

Related to outlier.remove in OLCPM...