#' Return mode of a vector of values
#'
#' Function that return mode that works for both numeric & character/factor data:
#'
#' @param x A vector of values
#'
#' @return A float number or string of characters that representing values presented
#' most frequently in the vector
#' @export
#'
#' @examples
#' coord_estimate <- mode(alf_gps$coord_rd)
mode <- function(x) {
ux <- unique(x)
ux[ which.max( tabulate(match(x, ux)) ) ]
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.