Description Usage Arguments Value Examples
A function for finding the most frequent element in a vector and optionally its frequency. The intended use is not for estimating mod statistic, but for finding a mod in sequences where elements repeat themselves often. Hence, it should not be used with vectors of real numbers, as such elements are likely to be unique. Note that the function is not capable of breaking ties randomly.
1 |
x |
A numeric, logical or a character vector where the mod needs to be found. |
freq |
A logical that indicates whether frequency of elements in the mod should be returned as well. By default set to FALSE. |
ties |
A string that indicates how the ties should be broken. Possible values are: "unbroken" in which case ties are not broken and all of the tied elements are returned in the output (in this case, if |
na.rm |
A logical that indicates whether NA elements should be removed or not. By default set to TRUE. |
If freq
set to FALSE, the output is a vector of the same class as x
with a single element, indicating the mod of the vector provided in x
. If freq
set to FALSE, the output is a list with first element being the mod and second element being the frequency of the mod.
1 2 3 4 5 6 7 8 9 10 11 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.