R/mode_non_numeric.R

Defines functions mode_nonnumeric

Documented in mode_nonnumeric

#' Non-numeric mode
#'
#' @param x Vector to find the mode over
#'
#' @return Mode
#' @export
#'

mode_nonnumeric <- function(x) {
  ux <- unique(x)
  ux[which.max(tabulate(match(x, ux)))]
}
roaldarbol/sleepr documentation built on May 9, 2024, 11:30 p.m.