[R] Group by

ManInMoon xmoon2000 at googlemail.com
Thu Mar 11 10:48:41 CET 2010


I have a matrix with a POSIXct as a numeric in the first column.

I would like to create a new matrix that is "grouped by" my chosed time
bars.

i.e. So I would like to group by hour or day or 5 days, and have all my
columns be summed or averaged or counted..

mydata:

V1,V2,V3
10:03:13,3.4,1002
10:03:14,5.6,1001
10:05:27,7.2,999
10:05:33,8.2,998

I want to convert this into say 5 minutes "bars" and sum columns

mynewdata:

V1,V2,V3
10:00:00,9.0,2003
10:05:00,15.4,1997


How can I do this?
-- 
View this message in context: http://n4.nabble.com/Group-by-tp1588694p1588694.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list