Skip to contents

Computes the lower and upper boundaries based on Median Absolute Deviation (MAD) from a numeric vector. Returns c(NA_real_, NA_real_) if the input vector has less than 2 elements.

Usage

get_mad_tails(x, k, na.rm = FALSE)

Arguments

x

a numeric vector

k

multiplier for the MAD

na.rm

if TRUE then NA values are stripped from x before computation takes place.

Value

a numeric vector of length 2 with the lower and upper boundaries.

Examples

x <- c(-100,1, 2, 3, 4, 100)
k <- 1.5
get_mad_tails(x, k)
#> [1] 1 4