Skip to contents

Calendars

Construct and inspect Calendar objects.

Calendar()
Calendar (S7 class)
calendar_from_leaves()
Build a Calendar from a flat table of leaf slices
calendar_build() calendar()
Build a Calendar from token names

Tokens

Reusable label vocabularies for one timeframe.

register_token() get_token() list_tokens()
Register or look up a calendar token

Timeframes

The atomic units underneath every calendar.

CORE_TIMEFRAMES
Core timeframe identifiers
as_timeframe()
Extract timeframe values from datetime vectors

Conversions

Move data between datetimes and calendars, and between calendars.

instant_to_slice()
Map datetimes to calendar slice IDs
expand_calendar()
Enumerate every instant in a year mapped to its calendar slice
recast()
Recast values from one calendar to another

Package

timescales timescales-package
timescales: Nested Timeframes and Calendars for Modeling