I have a dataframe that looks like this:
POI LOCAL.DATETIME
1 1 2017-07-11 15:02:13
2 1 2017-07-11 15:20:28
3 2 2017-07-11 15:20:31
4 2 2017-07-11 15:21:13
5 3 2017-07-11 15:21:18
6 3 2017-07-11 15:21:21
7 2 2017-07-11 15:21:25
8 2 2017-07-11 15:21:59
9 1 2017-07-11 15:22:02
10 1 2017-07-11 15:22:05
I want to be able to calculate (probably with lubridate) the cumulative time spent at each POI and combine them into a table that looks something like this:
POI TOTAL.TIME
1 1 00:18:18
2 2 00:01:11
3 3 00:00:03
Also, I am not sure how to deal with the time between POIs, like the 3 seconds between rows 2 and 3. I think maybe I need to calculate the time from row 1 to row 3 instead of row 1 to row 2.