remove_outliers: Remove outliers

View source: R/remove_outliers.R

remove_outliersR Documentation

Remove outliers

Description

Removes outliers based on their distance from the inter-quartile range (IQR). Excludes all points beyond coef times the IQR. The function uses the command boxplot.stats() which uses the Tukey's method to identify the outliers ranged above and below the coef*IQR.

Usage

remove_outliers(vec, coef = 1.5)

Arguments

vec

A vector of numeric values

coef

A number specifying the maximum distance from the inter-quartile range of vec for which values in vec are not replaced with NA.

Value

A vector of numeric values of length length(vec) with all elements identical as in vec except that outliers are replaced by NA.

Examples

## Not run: 
vec <- remove_outliers( vec, coef=3 ) 

## End(Not run)

stineb/ingestr documentation built on July 21, 2024, 6:39 p.m.