File: splitTime.Rd

package info (click to toggle)
r-cran-bbmisc 1.13.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,256 kB
  • sloc: ansic: 176; sh: 9; makefile: 5
file content (29 lines) | stat: -rw-r--r-- 808 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splitTime.R
\name{splitTime}
\alias{splitTime}
\title{Split seconds into handy chunks of time}
\usage{
splitTime(seconds, unit = "years")
}
\arguments{
\item{seconds}{[\code{numeric(1)}]\cr
Number of seconds. If not an integer, it is rounded down.}

\item{unit}{[\code{character(1)}]\cr
Largest unit to split seconds into.
Must be one of: \code{c("years", "days", "hours", "minutes", "seconds")}.
Default is \dQuote{years}.}
}
\value{
[\code{numeric(5)}]. A named vector containing the
\dQuote{years}, \dQuote{days}, \dQuote{hours}, \dQuote{minutes}
and \dQuote{seconds}. Units larger than the given \code{unit} are
\code{NA}.
}
\description{
Note that a year is simply defined as exactly 365 days.
}
\examples{
splitTime(1000)
}