Description Usage Arguments Examples
Convert between seconds and the more readable "HH:MM:SS" time format.
1 2 3 | hms_to_sec(hms)
sec_to_hms(sec, digits = 1, strip_zeros = FALSE)
|
hms |
character string; a time in the form "HH:MM:SS" ("HH:" is optional). |
sec |
numeric; seconds values. |
digits |
numeric (scalar); number of decimal places to be used for the seconds value in the "hours:minutes:seconds" string. |
strip_zeros |
logical; remove leading zeros? E.g. "00:26:01" becomes "26:01". |
1 2 3 | x <- c("00:21:05", "25:51", NA, "00:26:01.1", "01:05:02.0")
(x <- hms_to_sec(x))
(x <- sec_to_hms(x, strip_zeros = TRUE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.