R/mostcommon.R

#' Return the most common occurrence
#'
#' This function often used in apply.shrink
#'
#' @param x A vector
#'
#' @export
#'
mostcommon <- function(x) {
  x1 <- sort(table(x))
  x1 <- x1[length(x1)]
  return(as.numeric(names(x1)))
}
fishvice/husky documentation built on May 16, 2019, 1:12 p.m.