Compute the sample mode

ds_mode(x, na.rm = FALSE)

Arguments

x

a numeric vector containing the values whose mode is to be computed

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

Value

Mode of x

Details

Any NA values are stripped from x before computation takes place.

Deprecated Function

`stat_mode()` has been deprecated. Instead use `ds_mode()`.

See also

mean median

Examples

ds_mode(mtcars$mpg)
#> [1] 10.4
ds_mode(mtcars$cyl)
#> [1] 8