r - Converting over 24 hours into Date_Time -


i have data frame of cross channel swimming times. these range 6:35:00 43:00:00+. when try , convert date time using:

 as.posixlt(as.character(swims$times)  

r returns nas times greater 23:59:59.

i have tried searching online etc. have not found solution.

what best way of handling this?

pierre here sample of data

uniqueid time

1 187500001 21:45:00

2 191100001 22:35:00

3 192300001 26:50:00

4 192300002 16:33:00

5 192300003 16:58:00

6 192600001 14:39:00

nrussell: suggest instead of posixt?

the lubridate package has duration type. can convert times duration can work in conjunction dates.

in case can convert time listed hours:minutes:seconds seconds , coerce using:

library(lubridate) as.duration(as.double(substr(swim$time,1,2)) * 3600 + as.double(substr(swim$time,4,5)) * 60) 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -