pretty_dt: Pretty formatting of time intervals (difftime objects)

Description Usage Arguments Value See Also Examples

View source: R/time.R

Description

Pretty formatting of time intervals (difftime objects)

Usage

1
pretty_dt(dt, compact = FALSE)

Arguments

dt

A difftime object, a vector of time differences.

compact

If true, then only the first non-zero unit is used. See examples below.

Value

Character vector of formatted time intervals.

See Also

Other time: pretty_ms(), pretty_sec()

Examples

1
2
pretty_dt(as.difftime(1000, units = "secs"))
pretty_dt(as.difftime(0, units = "secs"))

Example output

[1] "16m 40s"
[1] "0ms"

prettyunits documentation built on Jan. 24, 2020, 9:06 a.m.