Description Usage Arguments Value Author(s) Examples
Generic function for the arithmetic mode.
1 | sample_mode(x)
|
x |
A numeric/character vector. |
This function returns the element in x
with the highest frequency.
If there are more than one values with the highest frequency,
it returns the first one (smallest one for numeric vector or
character vector in alphabetical order).
Xiaojing Ni
1 2 | sample_mode(c(1,2,2,3,3))
sample_mode(c("a","b","a"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.