stat_mode | R Documentation |
Computes the statistical mode, i.e. the value that appears most often in a vector. Returns the first match, if TRUE for multiple values.
stat_mode(x, ..., na.rm = FALSE)
x |
A vector of data values. |
... |
Further arguments, currently unused. |
na.rm |
a logical evaluating to |
The statistical mode with the same type as the input vector x.
vector_numeric <- sample(1:5, 15, TRUE)
vector_numeric
stat_mode(vector_numeric)
vector_character <- sample(LETTERS[1:5], 15, TRUE)
vector_character
stat_mode(vector_character)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.