powered by
Find the mode (i.e., most common value) in a numeric vector. In case of ties, the first encountered value is returned.
mode_value(x, na_flag = -9999)
The mode, numeric vector of length 1
numeric
A numeric or logical vector
logical
Value used to mark NA values in C code. This should be set to a value which is guaranteed to be absent from the input vector x (default is -9999).
NA
x
-9999
x = c(3, 2, 5, 5, 3, 10, 2, 5) mode_value(x)
Run the code above in your browser using DataLab