durations <- "01:01:01" #1 hour 1 min and 1 sec
How can I use base R to get the numeric 10-base representation of the seconds (or minutes) this corresponds to (it would be 3661 seconds) ?. Time (and dates) in R always hurts me. There are plenty of similar SO questions (e.g. here and here) but I still did not really get it right. One try was:
as.numeric(format(strptime('00:01:01', format='%H:%M:%S'), '%S'))