is_outlier: Check whether value is outlier

Description Usage Arguments Value See Also Examples

View source: R/stats.R

Description

is_outlier returns a logical vector indicating whether a value is an outlier based on the rule of 1.5 times the interquartile range above the third quartile or below the first quartile.

Usage

1
is_outlier(x, na.rm = FALSE)

Arguments

x

A numerical vector

na.rm

A logical value indicating whether NA values should be stripped before the computation proceeds. Defaults to FALSE.

Value

A logical vector.

See Also

stats::IQR(), stats::quantile()

Examples

1
2
x <- c(1:8, NA, 15)
is_outlier(x, na.rm = TRUE)

lvmisc documentation built on April 5, 2021, 5:06 p.m.