rm.outliers: Remove outliers

Description Usage Arguments Details Value Examples

View source: R/outliers.R

Description

Remove outliers from a vector.

Usage

1
2
rm.outliers(x, tail = "both", meth = "trim", probs = c(0.25, 0.75),
  sd = 2, na.rm = TRUE, ...)

Arguments

x

A vector

tail

One of 'both', 'left', or 'right'

meth

One of 'trim' or 'IQR'

probs

A 1 or 2 element numeric vector of probabilities

na.rm

A boolean whether to remove NA

sdn

when meth = 'sd', number of standard deviations away from the mean to detect outlier

Details

Each method will be described here in the future.

Value

A cleaned vector where all outliers outside of quantile(x,probs) (see details for individual methods) are changed to NA.

Examples

1
2
x <- rnorm(1000)
y <- rm.outliers(x,probs=c(.01,.99))

dnacombo/MaxPac documentation built on Nov. 17, 2021, 3:36 a.m.