I am working with a survey dataset. It has two string vectors, start and finish, indicating the time of the day when the interview was started, and finished, respectively.
They are character strings that look like: "9:24 am", "12:35 pm", and so forth. i am trying to calculate the duration of the interview based on these two. what is the best way of doing this?
i know that, for dates, there are lots of classes or functions like as.date()
, as.Date()
, chron()
, or as.POSIXct()
. So i was looking for something like as.time()
, but could not find it. Should I just append a made-up date and convert the whole thing into a POSIX()
date-time class, then use difftime()
?
What is the best practice of handling time in R?