View source: R/07_computeMode.R
mode | R Documentation |
Compute mode (most frequent value). The following cases are
covered: empty input, only NA
values, all values are equal, mode not
unique (i.e., several values appear with the same frequence).
mode(x, notUniqueVal = "notUnique", naVal = "allNA", emptyVal = "noValues")
x |
Vector |
notUniqueVal |
character: return value if mode is not unique |
naVal |
character: return value if all values in |
emptyVal |
character: return value if |
Character vector
mode(c(1, 1, 2, 3))
mode(1:5)
mode(1:5, 5)
mode(NA, NA, NA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.