In R, mean() and median() are standard functions which do what you\'d expect. mode() tells you the internal storage mode of the objec
mean()
median()
mode()
I found Ken Williams post above to be great, I added a few lines to account for NA values and made it a function for ease.
Mode <- function(x, na.rm = FALSE) { if(na.rm){ x = x[!is.na(x)] } ux <- unique(x) return(ux[which.max(tabulate(match(x, ux)))]) }