MODE {MSMU} | R Documentation |
Find the Mode of a Numeric Vector
Description
Calculates the mode (most frequent value) of a numeric vector. If there is a tie, returns all values that share the highest frequency.
Usage
MODE(x)
Arguments
x |
A numeric vector. |
Value
A numeric value (or vector) representing the mode(s) of x
.
Examples
# Mode of a Numeric Vector
MODE(c(1,2,3,3,3,4,5,5,3,8))
# Mode of the number of cylinders in mtcars dataset
data("mtcars")
MODE(mtcars$cyl)
[Package MSMU version 0.1.2 Index]