compute_mode

0th

Percentile

Compute The Mode

Computes the mode (most frequent value) of an atomic vector.

Usage
compute_mode(x, ties_method = "random", na_rm = TRUE)
Arguments
x

:: vector().

ties_method

:: character(1) Handling of ties. One of "first", "last" or "random" to return the first tied value, the last tied value, or a randomly selected tied value, respectively.

na_rm

:: logical(1) If TRUE, remove missing values prior to computing the mode.

Value

(vector(1)): mode value.

Aliases
  • compute_mode
Examples
# NOT RUN {
compute_mode(c(1, 1, 1, 2, 2, 2, 3))
compute_mode(c(1, 1, 1, 2, 2, 2, 3), ties_method = "last")
compute_mode(c(1, 1, 1, 2, 2, 2, 3), ties_method = "random")
# }
Documentation reproduced from package mlr3misc, version 0.1.0, License: LGPL-3

Community examples

Looks like there are no examples yet.