Getting unique rows of a table and their numbers

前端 未结 3 782
夕颜
夕颜 2020-12-12 01:44

I have a dataframe:

id  y   z
oX  79  100
oX  23  46
oX  10  29
uM  12  90
uT  43  50
uT  13  99

I would like to keeep unique rows based on

3条回答
  •  囚心锁ツ
    2020-12-12 02:08

    this will do what you want :

    > as.data.frame(table(a$id))
      Var1 Freq
    1   oX    3
    2   uM    1
    3   uT    2
    

提交回复
热议问题