knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
library(holidayplanneR)

holidayplanneR

The goal of holidayplanneR is to provide some functions that can allow users to gain useful information and/or more structured information about holidays.

Details and Recommendation

The function requires countries to be specified in the form of ISO 3166 country code and the country has to be within the 125 selected countries that are supported by the CalendarIndex API. The list of the 125 countries and their respective ISO 3166 country code be found in the countrycodes file in the data folder of this R package.

Users can sign up for their free CalendarIndex API key from this url: https://www.calendarindex.com/signup?plan=free

The CalendarIndex API key is required for all three functions in this holidayplanneR package.

It would be recommended, but not necessary, for user to store his/her CalendarIndex API in the .Renviron file as CALENDARINDEX_API_KEY.

Example

This is a basic example which shows you how to use the function isitholiday:

isitholiday("2018-12-31", "US", Sys.getenv("CALENDARINDEX_API_KEY"))

This is a basic example which shows you how to use the function holidaylist for one specific country:

holidaylist("US", "2018", Sys.getenv("CALENDARINDEX_API_KEY"))

This is a basic example which shows you how to use the function holidaylist with a list of (more than one) countries:

holidaylist(c("US", "AD"), "2016", api_key = Sys.getenv("CALENDARINDEX_API_KEY"))

This is a basic example which shows you how to use the function longholidays for one specific country:

longholidays(c("US"), "2018", api_key = Sys.getenv("CALENDARINDEX_API_KEY"))

This is a basic example which shows you how to use the function longholidays with a list of (more than one) countries:

longholidays(c("US", "AD"), "2016", api_key = Sys.getenv("CALENDARINDEX_API_KEY"))


ongzuchengmark/holidayplanneR documentation built on May 21, 2019, 10:12 a.m.