#' Mode of a Numeric Vector
#'
#' Computes the mode of a numeric vector using kernel density estimation.
#'
#' @noRd
#'
#' @param x A numeric vector.
#' @return The computed mode.
#'
numeric_mode <- function(x) {
object <- stats::density(x, n = 512, na.rm = TRUE)
rout <- object$x[which.max(object$y)]
return(rout)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.