r - How to sum values from same names? -


this question has answer here:

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

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -