Hello,
I have data frame like the one created below,
##input data
Person <- c(1,1,1,1,1,1,2,2)
Amount <- c(100,10,100,10,100,10,50,150)
Date <- c("12/01/2012", "12/01/2012",
"01/01/2013","01/01/2013","02/01/2013","02/01/2013","12/01/2012","12/01/2012")
df <- data.frame(Person,Amount,Date)
I would like to transpose the Amount data so that I can get the total amount
paid by person and date.
So, it would look something like:
##Want it to look like:
Person Date Amt1 Amt2
1 12/01/2012 100 10
1 01/01/2013 100 10
1 02/01/2013 100 10
2 12/01/2012 50 150
I have been working with reshape, but I am having trouble getting it to look
exactly right.
Thank you,
K
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.