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)))]
}
Content Protection by DMCA.com
Please Share