round_hms: Round or truncate to a multiple of seconds

Description Usage Arguments Value Examples

View source: R/round.R

Description

Convenience functions to round or truncate to a multiple of seconds.

Usage

1
2
3
round_hms(x, secs)

trunc_hms(x, secs)

Arguments

x

A vector of class hms

secs

Multiple of seconds, a positive numeric. Values less than one are supported

Value

The input, rounded or truncated to the nearest multiple of secs

Examples

1
2
3
round_hms(as_hms("12:34:56"), 5)
round_hms(as_hms("12:34:56"), 60)
trunc_hms(as_hms("12:34:56"), 60)

krlmlr/hms documentation built on Jan. 3, 2020, 7:20 a.m.