In R, mean() and median() are standard functions which do what you\'d expect. mode() tells you the internal storage mode of the objec
Could try the following function:
mode <- function(x){
y <- as.factor(x)
freq <- summary(y)
mode <- names(freq)[freq[names(freq)] == max(freq)]
as.numeric(mode)
}