I have a data frame with two columns for TIME. Time has the formatting H:M:S
dataframe <-
TIME1 TIME2
08:20:05 12:30:05
I want to calculate time difference in "hours" and put it in a column to data frame. I tried this but didn't work.
dataframe$TimeDif <- difftime(dataframe$TIME1, dataframe$TIME2, unit="hours")
This is the error msg I get: Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format