I found a answer on [SO](https://stackoverflow.com/questions/15505879/date-time-differences-between-rows-in-r), but that doesn't works for me. What I want is as follows: 

```
c_id    c_time
1    2012-08-15 00:00:30
1    2012-08-15 00:01:21
1    2012-08-15 00:01:25
2    2012-08-15 00:02:40
2    2012-08-15 00:03:41

```

I would like to get a time difference between first and last appearance of a c\_id variable in hours, minutes or seconds. 

```
c_diff
00:00:55 
00:01:01

```

Any help is highly appreciated!