Compute the sample mode

ds_mode(x, na.rm = FALSE)

Arguments

x a numeric vector containing the values whose mode is to be computed 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.

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