modus

0th

Percentile

Modus

Calculate the mode of a numeric vector. German name kept to avoid confusion.

Usage
modus(x, as_character = TRUE, reduce = TRUE)
Arguments
x

A vector with numeric data.

as_character

Always return a character. TRUE by default.

reduce

Since mode can be of length > 1, this option pastes the result into a single character value.

Value

A vector of length 1 of type numeric or character, depending on input.

Aliases
  • modus
Examples
# NOT RUN {
x <- c(1, 2, 6, 2, 1, 5, 7, 8, 4, 3, 2, 2, 2)
modus(x)

# Or for nominal data
x <- structure(c(2L, 1L, 2L, 2L, 2L, 1L), .Label = c("Ja", "Nein"), class = "factor")
modus(x)
# }
Documentation reproduced from package tadaatoolbox, version 0.16.0, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.