View source: R/parse_timeunit_tosecs.R
parse_timeunit_tosecs | R Documentation |
This is a convenience function for parsing a time together with its unit given as a string and converting it to seconds.
parse_timeunit_tosecs(input)
input |
String to be parsed. Must be in the format "[numeric] [unit]", with possible units ("seconds","minutes","hours","days"). Units can be abbreviated. |
List with converted time in seconds, the input time and unit as strings.
parse_timeunit_tosecs("30 minutes")
parse_timeunit_tosecs("0.5 hrs")
parse_timeunit_tosecs("1 d")
parse_timeunit_tosecs("500 secs")
## Not run:
parse_timeunit_tosecs("30min")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.