#' Calculate the mode of a vector.
#'
#' Returns the first value in case of ties
#' @export
mode <- function(x) {
ux <- unique(x)
mode <- ux[which.max(tabulate(match(x, ux)))]
mode
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.