R/get.mode.R

Defines functions get.mode

Documented in get.mode

###############################################################################################
##### Mode for numeric variables
###############################################################################################

get.mode <- function(x){
    x <- na.omit(x)
    uniquex <- unique(x)
    uniquex[which.max(tabulate(match(x, uniquex)))]
  }

Try the FinAna package in your browser

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

FinAna documentation built on May 2, 2019, 2:51 p.m.