Skip to contents

Calendars

Construct and inspect Calendar objects.

Calendar()
Calendar (S7 class)
calendar_from_leaftable()
Build a Calendar from a flat table of leaf timeslices
calendar_build() calendar()
Build a Calendar from token names
prune_calendar()
Derive a coarser calendar by truncating the hierarchy at a timeframe
upgrade_calendar()
Bring a Calendar to the current form

Query the timeframe hierarchy and subset calendars.

names(<Calendar>) calendar_timeframes() calendar_rank() calendar_timeslices()
Calendar hierarchy queries
calendar_leaftable() as.data.frame(<Calendar>) as.data.frame(<timescales::Calendar>) fortify(<Calendar>)
The leaftable of a Calendar
calendar_id()
The identity of a Calendar
calendar_tree()
The parts of a Calendar and which of them may change
calendar_family()
Immediate parent-child pairs of a Calendar hierarchy
calendar_ancestry()
All ancestor-descendant pairs of a Calendar hierarchy
calendar_children() calendar_parents() calendar_descendants() calendar_ancestors()
Navigate a Calendar hierarchy
calendar_next()
The timeslice that follows each timeslice
calendar_share()
Duration shares at a timeframe
calendar_width()
Unit, width and weight of the leaf timeslices, in hours
filter_calendar() `[`(<Calendar>) `[`(<timescales::Calendar>)
Filter a Calendar to selected members
calendar_source()
The calendar a subset was taken from
calendar_coverage()
Coverage of a sampled Calendar
summary(<Calendar>) summary(<timescales::Calendar>) print(<summary_Calendar>)
Summarize a Calendar

Catalog and data

The built-in calendar designs and sample data.

calendar_catalog()
The calendar catalog
calendars
Pre-built calendars from the catalog
merra2_cities
Hourly weather sample: twelve cities, year 2019

Tokens

Reusable label vocabularies for one timeframe.

Timeframes

The layers of time resolution a calendar is built from.

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

Conversions

Move data between datetimes and calendars, and between calendars.

datetime_to_timeslice()
Map datetimes to calendar timeslice IDs
tsl2dtm() dtm2tsl()
Convert between timeslices and datetimes
tsl2hour() tsl2yday() tsl2month() hour2HOUR() yday2YDAY()
Read a timeframe off timeslices
expand_calendar()
Enumerate the base grid of one or more model years mapped to timeslices
recast_calendar()
Recast values from one calendar to another
reexports recast
Objects exported from other packages
recast_to_datetime() recast_from_datetime()
Recast timeslice data down to the base grid, and back
calendar_map()
Crosswalk between two timeframes of a calendar
calendar_map_between()
Crosswalk between two calendars over the base grid
register_calendar_map() register_calendar_map_between() get_calendar_map() get_calendar_map_between()
Register / look up a direct calendar crosswalk
list_calendar_maps()
List the registered crosswalks
clear_calendar_maps()
Clear the crosswalk cache (and optionally the registered maps)
join_calendar()
Attach a calendar to a dataset
base_calendar()
Enumerate the base instant grid for one or more years

Visualization

Draw calendar structures and data on calendars.

calendar_layout()
Icicle layout of a calendar's structure
gg_calendar() autoplot(<Calendar>) plot(<Calendar>)
Plot a calendar
calendar_wall_layout()
Wall-calendar tile layout
calendar_weekdays()
Weekdays of a calendar's day layer in a given model year
geom_calendar() geom_calendar_tile() theme_calendar()
Calendar layers for ggplot2
calendar_breaks()
Thinned discrete breaks that keep the end values

Rules and registries

Aggregation and alignment semantics, and their registries.

CALENDAR_RULES
Supported aggregation rules
ALIGNMENT_RULES
Supported alignment rules
register_calendar_rule()
Register how a parameter should be recast
get_calendar_rule()
Look up a registered rule
list_calendar_rules()
List registered rules
clear_calendar_rules()
Clear the rule registry
register_calendar_conversion() get_calendar_conversion() list_calendar_conversions() clear_calendar_conversions()
Register a pairwise calendar conversion override

Package

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