Skip to contents

Linear Time Representations

Functions to create and work with linear time representations

Linear Time Vectors

The general function for creating linear time representations

linear_time()
Linear time points

Linear Time Helpers

Convenience functions for common linear time representations

Cyclical Time Representations

Functions to create and work with cyclical time representations

Cyclical Time Vectors

The general function for creating cyclical time representations

cyclical_time()
Cyclical time points

Cyclical Time Helpers

Convenience functions for common cyclical time representations

Time Manipulation

Functions for manipulating and transforming time objects.

seq(<mixtime>) seq(<mt_linear>) seq(<mt_cyclical>)
Generate sequences of mixtime values
round_time() ceiling_time() floor_time()
Round, floor and ceiling transformations for time objects

Calendar Systems

Calendar systems are composed of their associated time units. These define how time is divided and measured in different calendar systems.

Gregorian Calendar System

The standard civil calendar system with years, quarters, months, days, and sub-day units.

cal_gregorian
Gregorian time unit classes

ISO 8601 Calendar System

The ISO 8601 week date calendar system with ISO years and weeks.

cal_isoweek
ISO 8601 time unit classes

Custom Calendars

Functions for creating custom calendar systems

new_calendar()
Create a new calendar

Time Systems

Time systems define when the boundary of a day occurs and how a day is divided into time units. These can be combined with calendar systems to create custom time representations.

Civil Time System

The civil time system where each day begins at midnight on the 24-hour clock in a specific time zone.

cal_time_civil_midnight
Civil time unit classes

Solar Time Systems

Solar time systems where day boundaries are defined by solar events (sunrise, noon, or sunset) at specific geographic locations.

Timezones

Functions for working with timezones and timezone information

tz_name()
Extract timezone from an object
tz_offset()
Get timezone offset
tz_abbreviation()
Get timezone abbreviation
tz_transitions()
Get timezone transitions

Mixtime Objects

Functions for creating and working with mixtime objects that can contain multiple time granularities.

new_mixtime()
Create a new mixtime
as_mixtime()
Convert time class into a mixtime
is_mixtime()
Check if the object is a mixtime

Extensibility methods

These low-level functions define the relationships and labels between time units. Adding S7 methods for them allow the creation of custom time units and calendars.

chronon_cardinality() chronon_cardinality.S7_methods()
Cardinality between time units
chronon_convert() chronon_convert.S7_methods()
Convert between chronons
chronon_divmod() chronon_divmod.S7_methods()
Convert between chronons of different time units
chronon_common()
Find a common chronon from a set of chronons
chronon_granules()
Default linear time granules for chronons
mt_unit() mt_tz_unit() mt_loc_unit()
Base S7 class for creating new time units
time_chronon()
Obtain the chronon of a time object
time_calendar()
Obtain the calendar of a time object
time_unit_full() time_unit_abbr()
Time units as a string
cyclical_labels() cyclical_labels.S7_methods()
Friendly labels for cyclical relationships
mixtime_valid()
Check if times can be used within mixtime
new_cyclical_time_fn()
Cyclical time function factory
new_linear_time_fn()
Linear time function factory
circsum()
Compute circular rolling sums