mode.Rd
Generic function for finding the mode, supports multiple modes.
mode(x, max = FALSE, min = FALSE)
An R numeric vector
object.
Boolean
Return only the maximum value for mode if there are
multiple observed modes. Defaults to FALSE
.
Boolean
Return only the minimum value for mode if there are
multiple observed modes. Defaults to FALSE
.
The mode, most commonly occurring value in the vector, as a numeric
value. In cases where there are more than one mode, all values will be returned by default.
x <- c(1, 2, 3, 3, 3, 4, 4, 5, 5, 5)
mode(x)
#> [1] 3 5
mode(x, max = TRUE)
#> [1] 5
mode(x, min = TRUE)
#> [1] 3