Ich habe Daten wie folgt aus:Aggregate von paymentamount
emailaddress customer_acquisation_date customer_order_date payment_amount
[email protected] 01/05/2013 6:24 AM 01/05/2013 5:10 AM $ 20.67
[email protected] 01/05/2013 6:24 AM 02/07/2013 7:21 PM $ 25.56
[email protected] 01/05/2013 6:24 AM 07/10/2013 8:00 AM $100.00
[email protected] 01/05/2013 6:24 AM 08/12/2013 9:35 AM $30.00
I (Zahlungsbetrag) zu summieren, ich versuche, durch E-Mailadresse, wo ich die endgültige Ausgabe wollen als:
emailaddress customer_acquisation_date customer_order_date payment_amount
[email protected] 01/05/2013 6:24 AM 01/05/2013 $ 177
02/07/2013
07/10/2013
08/12/2013
Code Ich schreibe
z <- aggregate(x$emailaddress~x$paymentamount,data=x,FUN=sum)
Fehler ich erhalte
Error in Summary.factor(c(211594L, 291939L, 79240L, 208971L, 369325L, :
‘sum’ not meaningful for factors
Was ist der richtige Weg, dies zu tun. Irgendwelche Hilfe wird geschätzt
Nizza - viel schnellere data.table Lösung +1 – www