0

Possible Duplicate:
With R: Split time series data into time intervals (say an hour) and then plot the count

I have data with multiple columns and values, all having a timestamp every 10 seconds. The data spans several days, but I want to split it into pieces of for example 8 hours. I have been looking at split() and the plyr package but cannot find a proper way of doing this.

Can anyone help me with this problem?

Thanks in advance!

Community
  • 1
  • 1
Hemmik
  • 183
  • 1
  • 5
  • 1
    Can you post a small example dataset so we know what the timestamp looks like? – Marius Dec 10 '12 at 10:27
  • The timestamp has the following format: 2012-10-24 08:47 – Hemmik Dec 10 '12 at 10:29
  • 1
    See `?cut.POSIXt` and a possible related example at http://stackoverflow.com/a/13650168/1270695. Basically, if you have an actual date format, you should be able to use something like `split(mydata, cut(mydata, breaks="8 hours"))` to get subsets of your data. – A5C1D2H2I1M1N2O1R2T1 Dec 10 '12 at 10:32

0 Answers0