I would like to calculate time differences (delta time) in R. The timestamps are stored in a two-column data frame with time as date-time (year-month-day hour:min: sec.msec), e.g. for first three rows:
c_id c_time
6875 2012-08-15 00:00:40.169
6874 2012-08-15 00:01:40.055
6876 2012-08-15 00:02:40.542
I would like to have an output a column with differences e.g.
c_diff
0
00:01:0.886
00:01:0.487
Can someone please tell me how to do this? If you have other/better suggestion how to keep the result, it will be greatly appreciated Thanks so much in advance! Mishu