[R] Aggregating Data

Jeff Reichman reichmanj at sbcglobal.net
Wed Nov 15 00:03:33 CET 2017


R-Help

I created a "shortdate"  for the purpose of aggregating each var (S72 .S119)
by daily sum , but not sure how to handle using a POSIXlt object.

> myData$shortdate <- strftime(myData$time, format="%Y/%m/%d")
> head(myData)
                 time s72 s79 s82 s83 s116 s119  shortdate
1 2016-10-03 00:00:00   0   0   1   0    0    0 2016/10/03
2 2016-10-03 01:00:00   0   0   0   0    0    0 2016/10/03
3 2016-10-03 02:00:00   0   0   0   0   24    0 2016/10/03
4 2016-10-03 03:00:00   1   0   0   0    0    0 2016/10/03
5 2016-10-03 04:00:00   0   0   0   0    1    0 2016/10/03
6 2016-10-03 05:00:00   1   0   1   0    0    1 2016/10/03

Jeff


	[[alternative HTML version deleted]]



More information about the R-help mailing list