d_mode: Calculate the mode

View source: R/utils.R

d_modeR Documentation

Calculate the mode

Description

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

Usage

d_mode(x)

Arguments

x

A vector.

Value

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

Examples

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

examly documentation built on Nov. 19, 2026, 5:11 p.m.