R/mode.val.r

Defines functions mode.val

Documented in mode.val

#' To calculate the modal value of the data
#'
#' This function calculates the value of the mode of the data
#' that is provided
#'
#' @param x The data that is provided
#'
#' @return \code{} Gives the mode
#'
#' @author Karuna Reddy <reddy_k@usp.ac.fj>\cr
#' MGM Khan <khan_mg@usp.ac.fj>
#'
mode.val <- function(x) {
      uniqx <- unique(x)
      uniqx[which.max(tabulate(match(x, uniqx)))]
}
#########################################################

Try the stratifyR package in your browser

Any scripts or data that you put into this service are public.

stratifyR documentation built on Sept. 27, 2019, 5:04 p.m.