mads: Median absolute deviation

Description Usage Arguments See Also Examples

View source: R/mads.R

Description

Computes the median absolute deviation.

Usage

1
2
3
mads(x, scale = 1.482602, .f = median, ...)

abs_dev(x, .f = median, ..., scale = 1.4826)

Arguments

scale

A scaling factor; defaults to 1.482602

.f

The centering function

...

Additional arguments passed to '.f'

See Also

[stats::mad()]

Examples

1
2
3
4
5
6
7
## standard implementation
mads(iris[,1])
mads(iris[1:2])
mads(iris[1:2], scale = 1)

mads(iris$Sepal.Width, mean, na.rm = TRUE) %>% head()
mads(iris$Sepal.Width, function(x) mean(x / 2)^3) %>% head() ## for demonstration

jmbarbone/qpm documentation built on July 25, 2020, 10:41 p.m.