Answers for "mode in r"

R
2

mode in r

# No in-built R function for this, create custom function:
getmode <- function(v) {
   uniqv <- unique(v)
   uniqv[which.max(tabulate(match(v, uniqv)))]
}
Posted by: Guest on December-04-2021
1

how to get the mode in r

library(DescTools)
Mode(name)
# make sure to inculde this libirary before you use the function
# install if necessary 
# name is the dataset's name you want to get it's mode
Posted by: Guest on December-14-2021

Browse Popular Code Answers by Language