remove.outlier: Remove Outliers

View source: R/dthelper-computation-functions.R

remove.outlierR Documentation

Remove Outliers

Description

Changes outliers to NAs. Outliers are determined based on how far they are away from the mean. If they cross the specified threshold (default as 2 SDs away from mean), then its is treated as an outlier

Usage

remove.outlier(x, sd.away = 2, na.rm = T, print.outlier = TRUE)

Arguments

x

vector object

sd.away

Number of SDs away from mean. Used to compute threshold for outliers.

na.rm

If set to TRUE, NAs are ignored in computation

print.outlier

If set to TRUE, number of outliers will be printed

Value

vector object

Examples

set.seed(100)
x <- rnorm(100)
remove.outlier(x)


dennisteowh/dthelper documentation built on March 19, 2022, 11:42 a.m.