prettyunits (version 1.2.0)

pretty_dt: Pretty formatting of time intervals (difftime objects)

Description

Pretty formatting of time intervals (difftime objects)

Usage

pretty_dt(dt, compact = FALSE)

Value

Character vector of formatted time intervals.

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.

See Also

Other time: pretty_ms(), pretty_sec()

Examples

Run this code
pretty_dt(as.difftime(1000, units = "secs"))
pretty_dt(as.difftime(0, units = "secs"))

Run the code above in your browser using DataLab