I have a df in R in the following format. What could be the easiest way to aggregate this on an hourly time interval basis, currently it is every minute
theTime24 Amount
988 2015-02-04 23:53:00 2
989 2015-02-04 23:55:00 1
990 2015-02-04 23:56:00 3
991 2015-02-04 23:57:00 2
992 2015-02-04 23:58:00 1
993 2015-02-04 23:59:00 2
format
to group by hour, along the lines ofaggregate(Amount ~ format(as.POSIXct(dat$theTime24), "%Y-%m-%d %H"), data=dat, sum)
[assuming the function issum
] – user20650