Mode | R Documentation |
Most frequent value in vector or matrix
Mode(x)
x |
Real or complex vector or of factor levels. |
Computes the ‘sample mode’, i.e. the most frequently occurring value in x.
Among values occurring equally frequently, Mode()
chooses the
smallest one (for a numeric vector), one with a smallest absolute value
(for complex ones) or the first occurring value (for factor levels).
A matrix will be changed to a vector.
One element from x and of the same type. The number of occurrences will not be returned.
In Matlab/Octave an array dimension can be selected along which to find the mode value; this has not been realized here.
Shadows the R function mode
that returns essentially the type
of an object.
median
x <- round(rnorm(1000), 2)
Mode(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.