timespan | R Documentation |
Timespans
timespan(units, num = 1L, ...)
new_timespan(units, num = 1L)
is_timespan(x)
timespan_unit(x)
timespan_num(x)
units |
A unit of time, e.g.
|
num |
Number of units. E.g. |
... |
Further arguments passed onto methods. |
x |
A timespan. |
timespan()
can be used to create objects of class 'timespan' which are
used widely in timeplyr.
new_timespan()
is a bare-bones version that
does no checking or string parsing and is
intended for fast timespan creation.
timespan_unit()
is a helper that extracts the unit of time of the timespan.
timespan_num()
is a helper that extracts the number of units of time.
A timespan object.
library(timeplyr)
timespan("week")
timespan("day")
timespan("decade")
# Multiple units of time
timespan("10 weeks")
timespan("1.5 hours")
# These are all equivalent
timespan(NULL, 3);timespan(3);timespan(NA_character_, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.