I have a vector of seconds:
(z <- c(36, 36000, 360000, 36000000))
And I would like to convert them to a pretty durations. lubridate is the obvious place,
lubridate::duration(z, "seconds")
#[1] "36s" "36000s (~10 hours)"
#[3] "360000s (~4.17 days)" "36000000s (~1.14 years)"
which gives me exactly what I want (the bit in brackets). But the format.Duration()
isn't exported
so it's a bit tricky getting the values I want.