| mt_duration-arithmetic | R Documentation |
mt_duration)Durations (e.g. days(3)) support:
Combining: a + b and a - b give a duration in their finest common
chronon. The chronons must have a fixed ratio, so months(1) + days(1)
is an error.
Ratios: a / b is a number (e.g. weeks(1) / days(1) is 7).
Scaling: d * n, n * d and d / n.
Adding numbers: d + n and d - n count n in d's chronon.
Adding a duration to a time point shifts it, see mt_time-arithmetic.
## S4 method for signature 'mt_duration'
e1 + e2
## S4 method for signature 'mt_duration'
e1 - e2
## S4 method for signature 'mt_duration'
e1 * e2
## S4 method for signature 'mt_duration'
e1 / e2
e1, e2 |
Operands, at least one a duration ( |
A duration, or a number for the ratio of two durations.
weeks(1) + days(2)
weeks(1) / days(1)
days(3) * 2
try(months(1) + days(1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.