ds_mdev: Mean Absolute Deviation

View source: R/ds-describe.R

ds_mdevR Documentation

Mean Absolute Deviation

Description

Compute the mean absolute deviation about the mean

Usage

ds_mdev(data, x = NULL)

Arguments

data

A numeric vector or data.frame.

x

Column in data.

Details

The ds_mdev function computes the mean absolute deviation about the mean. It is different from mad in stats package as the statistic used to compute the deviations is not median but mean. Any NA values are stripped from x before computation takes place

See Also

mad

Examples

# vector
ds_mdev(mtcars$mpg)

# data.frame
ds_mdev(mtcars, mpg)


descriptr documentation built on April 3, 2025, 8:46 p.m.