I'm using an Excel dataset where the time values, MM:SS, come in numeric values that I need to convert to POSIXct in r and then make calculations.
Below is sample data of what I have and I need to get
dfOrig <- data.frame(StandarTime = c(615,735,615 ),
AchievedTime = c(794,423,544 ))
This is what I'm looking for:
dfCleaned <- data.frame(StandarTime = c("2017-08-25 10:15",
"2017-08-25 12:15",
"2017-08-25 10:15" ),
AchievedTime = c("2017-08-25 13:14 PDT",
"2017-08-25 7:03 PDT",
"2017-08-25 9:04 PDT" ))
I'm not sure how to best approach this problem.
Not sure what the values are but in case these are seconds you can use:
ISOdate(2017, 8, 25, hour = 0)
sets the start time, then you can add a value in seconds. You can also specify a time zone usingtz = ""