Mode in R

There is No in-built function for this in R language, we need to a create custom function:

getmode <- function(val) {
   uniqv <- unique(val)
   uniqv[which.max(tabulate(match(val, uniqv)))]
}
Please follow and like us:
Content Protection by DMCA.com