powered by
The calendars can be specified in JSON files and these functions helps with importing and exporting calendars to text files.
save_calendar(cal, con)load_calendar(con)
load_calendar(con)
the calendar's name
a connection object or a character string.
Here's an example of a calendar's specification.
{ "name": "Brazil/ANBIMA", "weekdays": ["saturday", "sunday"], "holidays": ["2001-01-01", "2001-02-26", "2001-02-27", "2001-04-13"], "adjust.from": "following", "adjust.to": "preceding" "financial": true, }
save_calendar exports a calendar to a JSON file and load_calendar imports.
save_calendar
load_calendar
In load_calenadar, the con argument can be a connection object or a character string specifying either the file or the JSON text.
load_calenadar
con
con <- tempfile(fileext = ".json") save_calendar("actual", con) load_calendar(con)
Run the code above in your browser using DataLab