Learn R Programming

examly (version 0.2.0)

d_mode: Calculate the mode

Description

Finds the most frequent value (the mode) in a vector.

Usage

d_mode(x)

Value

The mode of the vector. Returns NA if the vector is empty.

Arguments

x

A vector.

Examples

Run this code
d_mode(c(1, 2, 2, 3, 3, 3, 4))
d_mode(c("a", "b", "a"))

Run the code above in your browser using DataLab