Mode: Compute the mode of a vector (can be multiple results).

View source: R/Mode.R

ModeR Documentation

Compute the mode of a vector (can be multiple results).

Description

Via http://stackoverflow.com/questions/2547402/is-there-a-built-in-function-for-finding-the-mode

Usage

Mode(x, exclude_na = TRUE)

Arguments

x

vector

exclude_na

Exclude NA from being a possible mode.

Value

Vector of modal values in arbitrary order.

Examples


library(ck37r)

data(Boston, package = "MASS")

table(Boston$chas)

Mode(Boston$chas)


ck37/ckTools documentation built on April 29, 2023, 11:47 p.m.