The goal of academiadates is to extend tsibble by adding a new class which is built to assist handling date intervals that are common in academic institutions, that being three terms annually.
lubridate has quarter()
and semester()
methods to access the quarter or semester from a date. This lacks the functionality for a variable number of periods per year which was proposed in tidyverse/lubridate#1134
, but has not received any further work.
tsibble has support for quarters in its ecosystem. It also provides scales which wrap ggplot2’s date scales. These can be seen throughout Forecasting: Principles and Practice by Hyndman and Athanasopoulos. The first example of a quarter timescale is in Figure 1.1.
Installation
You can install the development version of academiadates from GitHub with:
# install.packages("pak")
pak::pak("Steven314/academiadates")
# or
# install.packages("remotes")
remotes::install_github("Steven314/academiadates")
To get started check out vignette("intro")
.
Related Resources
Some adjacent GitHub issues and SO content that covers some brainstorming and work surrounding extending tsibble:
- Stack Overflow answer: R tsibble add support of custom index
tidyverse/lubridate#1134
tidyverts/tsibble#316
tidyverts/tsibble#207