mode.value: Determine the mode of any given vector 'x'

Description Usage Arguments Value Examples

Description

It's kinda dumb that R doesn't have a built-in mode function. So here.

Usage

1

Arguments

x

vector of values; can be integers/strings/booleans/etc.

Value

value the value that occurs most often

Examples

1
2
3
# Construct vector where 10 appears three times.
x <- c(1:10, 10:20, 10:30)
mode.value(x)

dataframing/archive documentation built on May 20, 2019, 10:19 p.m.