modal: Statistical mode (central tendency measurement)

Description Usage Arguments Value Examples

View source: R/modal.R

Description

This calculates the statistical mode of an at least nominal variable, the value with the highest frequency.

Usage

1
modal(x)

Arguments

x

An atomic vector.

Value

A scalar value with the type of x.

Examples

1
2
3
4
# metric
modal(c(1, 1, 2, 2, 2, 3, 3)) # 2
# nominal
modal(c("a", "b", "b", "c")) # b

strategic-games/sg.data documentation built on June 21, 2020, 8:30 a.m.