Mode: Mode

Description Usage Arguments Value Examples

View source: R/General.R

Description

Computes the mode of a numeric vector. R does not have a built in function for computing the mode (the most frequent value) in a vector of numeric values. This function (Note: Mode with a capital M) returns the mode.

Usage

1
Mode(v)

Arguments

v

(numeric) a numeric vector

Value

(numeric) The mode as a numeric

Examples

1
2
3
4
x <- c(rep(1:3, each = 2),rep(4,3))
Mode(x)
dat <- data.frame(y = rnorm(15,0,1),x = {rnorm(15,0,1) + rnorm(15,0,.02)})
apply(dat, 2, Mode)

yogat3ch/HDA documentation built on Sept. 13, 2019, 8:54 p.m.