R/mathMode.R

Defines functions mathMode

Documented in mathMode

#'returns the mode of a vector
#' @param x A vector of numbers
#' @return the mode of a vector
#' @export
mathMode <- function(x)
{
  uniqueVals=unique(x)
  uniqueVals[which.max(tabulate(match(x,uniqueVals)))]
}
rgamble819/MATH4753ouGamb0004 documentation built on April 20, 2021, 10:34 p.m.