finding timestamp difference for a day in R -
finding timestamp difference for a day in R -
i have info in interval of 15 minutes , need find time difference between next record , current record using r not able do. can help here?
timestamp id timediff 07/29/2014 10:15 189252 0:15 07/29/2014 10:45 189252 0:30 07/29/2014 11:00 189252 0:15 07/29/2014 11:15 189252 0:15 07/29/2014 11:30 189252 0:15 07/29/2014 11:45 189252 0:15 07/29/2014 12:00 pm 189252 0:15 07/29/2014 12:15 pm 189252 0:15 07/29/2014 12:30 pm 189252 0:15 07/29/2014 01:00 pm 189252 0:30 07/29/2014 01:15 pm 189252 0:15 07/29/2014 01:30 pm 189252 0:15 07/29/2014 01:45 pm 189252 0:15
this straightforward long info in appropriate date-time format:
> foo <- as.posixct(c("07/29/2014 10:15","07/29/2014 10:45"), format="%m/%d/%y %h:%m") > foo [1] "2014-07-29 10:15:00 cest" "2014-07-29 10:45:00 cest" > diff(foo) time difference of 30 mins
look @ ?as.posixct
, ?strptime
.
r
Comments
Post a Comment