stat_mode {nflreadr} | R Documentation |
Statistical Mode
Description
Computes the statistical mode, i.e. the value that appears most often in a vector. Returns the first match, if TRUE for multiple values.
Usage
stat_mode(x, ..., na.rm = FALSE)
Arguments
x |
A vector of data values. |
... |
Further arguments, currently unused. |
na.rm |
a logical evaluating to |
Value
The statistical mode with the same type as the input vector x.
Examples
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)
[Package nflreadr version 1.4.1 Index]