| calendar_gregorian | R Documentation |
Time unit constructors for the Gregorian calendar system. These units can be
used with linear_time() to create custom time representations.
cal_gregorian
A civil-based calendar containing Gregorian time units.
The following time units are available in the Gregorian calendar (cal_gregorian$).
year(): Year unit
quarter(): Quarter (3-month period) unit
month(): Month unit
day(): Day unit
hour(): Hour unit
minute(): Minute unit
second(): Second unit
millisecond(): Millisecond unit
These units form a hierarchy where conversions between adjacent units follow the Gregorian calendar rules. For units that don't have a fixed relationship (e.g., months to days), the conversion requires a time context.
A calendar (an S7 mt_calendar object of class cal_gregorian) containing
the named time unit classes of the Gregorian calendar. Each unit is
accessible via $ notation and calling it with a step size produces a
time granule (e.g., 1 month granule as cal_gregorian$month(1L)).
linear_time() for creating linear time points.
# Create a custom time representation using Gregorian units
linear_time(
Sys.time(),
chronon = hour(1L)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.