r - How to sum values from same names? -
this question has answer here:
- consolidate duplicate rows 6 answers
r program
i need sum values same names repeated in list.
i have list like,
person money 1 1 3 2 2 1 3 1 2 4 3 1 5 2 1
i need,
person money 1 1 (3+2=)5 2 2 2 3 3 1
here solution ddply
plyr
library(plyr) z=data.frame(ddply(yourdataframe,.(person),summarise))
Comments
Post a Comment