0

now I have a table which contains the frequency of the number for many files. But they write the frequency of different files below each other rather than combine them together. Now I want to add those number up. could anyone tell me how can I do that? Thank you

 #example df
 k <- data.frame(Number = c(1,2,3,1,2,3),Frequency = c(452,222,315,98,5,32))
 #Now I want to add the frequency of the same number together
 #For example the row 1 and row 4
 >k
   Number Frequency
 1      1       452
 2      2       222
 3      3       315
 4      1        98
 5      2         5
 6      3        32
 #The ideal result
        Number Frequency
 1      1       550
 2      2       227
 3      3       347
Codezy
  • 662
  • 5
  • 17

0 Answers0