| component_helpers | R Documentation |
lin(), cyc() and dur() name the time components addressed by mixtime's
component-aware contexts — a single vocabulary shared across format() (and
parsing) format strings and time_components() expressions. They are only
meaningful inside one of these contexts; calling them directly is an error.
lin(granule)
cyc(granule, cycle)
dur(granule)
granule |
The time granule to address, given as a granule generator (e.g.
|
cycle |
The coarser granule defining the cycle a |
A linear and a cyclical component of the same granule store the same value:
the count of that chronon since the Unix epoch. The reduction to a within-cycle
position happens only when a cyclical vector is formatted. cyc() therefore
behaves like lin() on its finest granule but additionally records the cycle.
dur() addresses a duration (an unanchored span of time, see duration())
counted in units of a granule, e.g. "{dur(day)}" formats and parses text
like "3 days". A duration has no position in the calendar, so dur() must
be the only token in its format string and isn't available in
time_components(). Its granule is always a 1-unit granule, so
dur(hour(3L)) behaves like dur(hour).
A component specification, consumed internally by the component-aware
context (e.g. format(), time_parse() or time_components()).
format(), time_parse(), time_components() and duration()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.