calendar-import-export: Import and export calendars

calendar-import-exportR Documentation

Import and export calendars

Description

The calendars can be specified in JSON files and these functions helps with importing and exporting calendars to text files.

Usage

save_calendar(cal, con)

load_calendar(con)

Arguments

cal

the calendar's name

con

a connection object or a character string.

Details

save_calendar exports a calendar to a JSON file and load_calendar imports.

In load_calenadar, the con argument can be a connection object or a character string specifying either the file or the JSON text.

JSON calendar's specification

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,
  }

Examples

con <- tempfile(fileext = ".json")
save_calendar("actual", con)
load_calendar(con)

bizdays documentation built on May 29, 2024, 11:56 a.m.