How to find the statistical mode?

前端 未结 30 1691
时光取名叫无心
时光取名叫无心 2020-11-21 07:00

In R, mean() and median() are standard functions which do what you\'d expect. mode() tells you the internal storage mode of the objec

30条回答
  •  终归单人心
    2020-11-21 08:03

    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]
    

提交回复
热议问题