Name of member Allowance Type Expenditure Type Date Amount, £
Adam Afriyie Office running costs (IEP/AOE) Incidentals 07/03/2009 111.09
Adam Afriyie Office running costs (IEP/AOE) Incidentals 11/05/2009 111.09
Adam Afriyie Office running costs (IEP/AOE) Incidentals 11/05/2009 51.75
Adam Holloway Office running costs (IEP/AOE) Incidentals 10/01/2009 35
Adam Holloway Office running costs (IEP/AOE) Incidentals 10/01/2009 413.23
Adam Holloway Office running costs (IEP/AOE) Incidentals 10/01/2009 9.55
Adam Holloway Office running costs (IEP/AOE IT equipment 07/03/2009 890.01
Adam Holloway Communications Expenditure Publications 12/04/2009 1774
Adam Holloway Office running costs (IEP/AOE) Incidentals 12/08/2009 1.1
Adam Holloway Office running costs (IEP/AOE Incidentals 12/08/2009 64.31
Adam Holloway Office running costs (IEP/AOE) Incidentals 12/08/2009 64.31
Hi im new to R and new to programming. This is a subset of the MP's expenses during a certain time period. I want to subtotal each MP's expenses and i used the code from another post
> aggregate(cbind(bsent, breturn, tsent, treturn, csales) ~ yname, data = foo,
+ FUN = sum)
and edited it to my own situation.
my code:
expenses2 <- aggregate(cbind(Amount..Â.) ~ Name.of.member, data = expenses, FUN = sum)
now although this code does do some sort of aggregation the numbers do not match up. for example one can calculate that Adam Afriyie's expenses are £273.93 however this code gives a result of 12697. I have no idea what this number represents. Can someone help me and tell me what im doing wrong??
Thank you in advance