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()
found this on the r mailing list, hope it's helpful. It is also what I was thinking anyways. You'll want to table() the data, sort and then pick the first name. It's hackish but should work.
names(sort(-table(x)))[1]