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()
Another simple option that gives all values ordered by frequency is to use rle:
rle
df = as.data.frame(unclass(rle(sort(mySamples)))) df = df[order(-df$lengths),] head(df)