I'm trying to manipulate data that measures swimming times in different events, but the formatting of the data given is giving me trouble. Some events where times are fast are only measured in seconds and appear as numbers in the format 55.97 for example. Other events with longer times are only in the format mm:ss.00 as character strings, for example 1:58.90. And still some events have a combination of both. I want to be able to manipulate the data to from different types of plots so I need R to understand that 59.99 is right next to 1:00.00. Is this possible?
Here's a simpler version of the data I am working with:
I have never had to work with bare times, without a date, so I cannot comment on the best way to transform those character values into useful numeric times. I'm sure you can web search that as well as I can.
I was wondering about times a couple of days ago and I think @mvogliano has a serious problem. I don't know much about time and date functions but it looks like, perhaps, only chron easily handles times but I cannot see how there is anyway to handle that dog's breakfast of formats.
I think the only way might be to separate the times into character values of equal lengths and use paste0() to pad the data to the left to get a consistent X:XX.X format though a XX:XX:XX is likely better.