R/modus.R

#' function for getting mode source: http://stackoverflow.com/a/8189441/1144966
#' @param x vector for which the mode should be returned
modus <- function(x) {
  ux <- unique(x)
  ux[which.max(tabulate(match(x, ux)))]
}
petermeissner/idep documentation built on May 25, 2019, 1:53 a.m.