Learn R Programming

cycleRtools (version 1.1.1)

convert_time: Reformat time.

Description

Functions perform interconversion between "HH:MM:SS" format and seconds.

Usage

convert_from_time(x)
convert_to_time(x)

Arguments

x
either a character string of the form "HH:MM:SS" ("HH" is optional) or numeric seconds values.

Value

seconds value(s) for from, and "HH:MM:SS" character string(s) for to.

Examples

Run this code
x <- c("00:21:05", "25:51", NA, "00:26:01.1", "01:05:02.0")
x <- convert_from_time(x)
print(x)
x <- convert_to_time(x)
print(x)

Run the code above in your browser using DataLab