powered by
Estimates the mode of a numeric vector using kernel density estimation. Falls back to median if density estimation fails.
calculate_mode(x)
A single numeric value representing the estimated mode.
A numeric vector.
set.seed(123) x <- rnorm(100, mean = 5, sd = 1) calculate_mode(x)
Run the code above in your browser using DataLab