I am looking for a way to make regular discrete time intervals in R with data that is irregular and includes location information. (For example, 10 second intervals, and only the first location information per time interval).
The input data looks like this:
ID Time Location Duration
1 Mark 2015-04-15 23:55:41 1 145448
2 Mark 2015-04-15 23:58:07 9 1559
3 Mark 2015-04-15 23:58:08 9 2279
4 Mark 2015-04-15 23:58:11 9 557
5 Mark 2015-04-15 23:58:11 3 10540
6 Mark 2015-04-15 23:58:22 9 1783
7 Mark 2015-04-15 23:58:24 9 8706
8 Mark 2015-04-15 23:58:32 9 555
9 Mark 2015-04-15 23:58:33 2 124137
10 Mark 2015-04-16 00:00:37 2 7411
11 Mark 2015-04-16 00:00:37 20 7411
and the desired output would be:
ID Time Location
1 Mark 2015-04-15 23:55:40 1
2 Mark 2015-04-15 23:55:50 1
3 Mark 2015-04-15 23:56:00 1
...
16 Mark 2015-04-15 23:58:00 9
17 Mark 2015-04-15 23:58:10 9
Any ideas?