R/get_mode.r

Defines functions get_mode

Documented in get_mode

#' Get the mode of a numeric or character matrix

get_mode <- function(x) {
  ## Original Code: http://stackoverflow.com/questions/2547402/standard-library-function-in-r-for-finding-the-mode
  ux <- unique(x)
  ux[which.max(tabulate(match(x, ux)))]
}
woobe/bib documentation built on May 4, 2019, 9:47 a.m.