Learn R Programming

descriptr (version 0.6.1)

ds_mode: Mode

Description

Compute the sample mode

Usage

ds_mode(data, x = NULL)

Value

Mode of x

Arguments

data

A numeric vector or data.frame.

x

Column in data.

Details

Any NA values are stripped from x before computation takes place. If several values are tied for the highest frequency, the smallest of them is returned.

See Also

Examples

Run this code
# vector
ds_mode(mtcars$mpg)

# data.frame
ds_mode(mtcars, mpg)

Run the code above in your browser using DataLab