Guest User

Untitled

a guest
Nov 19th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. ## Your data
  2. Row = c(11131132, 10004, 5, 265098, 3, 190029, 2,
  3. 265092, 2, 265077, 17, 10004, 18,
  4. 265097,17, 265098,15,190029,2, 265099,17)
  5.  
  6. ID = Row[seq(2,length(Row), 2)]
  7. value = Row[seq(3,length(Row), 2)]
  8. GroupSum = aggregate(value, list(ID), sum)
  9. GroupSum
  10. Group.1 x
  11. 1 10004 23
  12. 2 190029 4
  13. 3 265077 17
  14. 4 265092 2
  15. 5 265097 17
  16. 6 265098 18
  17. 7 265099 17
Add Comment
Please, Sign In to add comment