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()
Here, another solution:
freq <- tapply(mySamples,mySamples,length) #or freq <- table(mySamples) as.numeric(names(freq)[which.max(freq)])