R/getmode.R

Defines functions getmode

Documented in getmode

#' @title getmode
#' @description get the most frequent value
#' @param v vector
#' @export
getmode <- function(v) {
  uniqv <- unique(v)
  uniqv[which.max(tabulate(match(v, uniqv)))]
}
2econsulting/rAutoFS documentation built on May 30, 2019, 3:07 a.m.