Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

splitTime

Split seconds into handy chunks of time.


Description

Note that a year is simply defined as exactly 365 days.

Usage

splitTime(seconds, unit = "years")

Arguments

seconds

[numeric(1)]
Number of seconds. If not an integer, it is rounded down.

unit

[character(1)]
Largest unit to split seconds into. Must be one of: c("years", "days", "hours", "minutes", "seconds"). Default is “years”.

Value

[numeric(5)]. A named vector containing the “years”, “days”, “hours”, “minutes” and “seconds”. Units larger than the given unit are NA.

Examples

splitTime(1000)

BBmisc

Miscellaneous Helper Functions for B. Bischl

v1.11
BSD_2_clause + file LICENSE
Authors
Bernd Bischl [aut, cre], Michel Lang [aut], Jakob Bossek [aut], Daniel Horn [aut], Jakob Richter [aut], Dirk Surmann [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.