Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Your data
- Row = c(11131132, 10004, 5, 265098, 3, 190029, 2,
- 265092, 2, 265077, 17, 10004, 18,
- 265097,17, 265098,15,190029,2, 265099,17)
- ID = Row[seq(2,length(Row), 2)]
- value = Row[seq(3,length(Row), 2)]
- GroupSum = aggregate(value, list(ID), sum)
- GroupSum
- Group.1 x
- 1 10004 23
- 2 190029 4
- 3 265077 17
- 4 265092 2
- 5 265097 17
- 6 265098 18
- 7 265099 17
Add Comment
Please, Sign In to add comment