Is there a way, in base R, to (try to) convert a string that may contain time-lapse information into seconds?
What I mean is some way where strings like '30 min'
, '1800 s'
, '0.5 h'
, '00:30:00'
would all be converted to 1800
. The idea is similar to what the Linux command at
does when it interprets time information.
Similar question is this, but in my case I’m interested in time lapses, not time points (dates), and I don’t know beforehand the time format used in the string.
Cheers!