modalvalue: Determine the mode of a distribution

View source: R/utilities.R

modalvalueR Documentation

Determine the mode of a distribution

Description

Find the most common entry in a vector. Ties are not allowed, the first value encountered within the modal set if there are ties is deemed the mode.

Usage

modalvalue(x)

Arguments

x

numeric vector.

Value

Numeric value of the mode.

Examples

 d1 <- c(1, 1, 1, 2, 2, 3)
 modalvalue(d1)


LDATS documentation built on Sept. 19, 2023, 5:08 p.m.