holidays | R Documentation |
Gets the days corresponding to the holidays
holidays( calendar, start, length, nonworking = c(6, 7), type = c("Skip", "All", "NextWorkingDay", "PreviousWorkingDay"), single = FALSE )
calendar |
The calendar |
start |
First day of the calendar in the format |
length |
Length of the calendar. |
nonworking |
Indexes of non working days (Monday=1, Sunday=7). |
type |
Adjustment type when a holiday falls a week-end: |
single |
boolean indication if a single variable ( |
A matrix where each column is associated to a holiday (in the order of creation of the holiday) and each row to a date.
belgiumCalendar<-calendar.new() calendar.fixedday(belgiumCalendar, 7, 21) calendar.holiday(belgiumCalendar, "NEWYEAR") calendar.holiday(belgiumCalendar, "CHRISTMAS") calendar.holiday(belgiumCalendar, "CHRISTMAS", offset=1, weight=.5) calendar.holiday(belgiumCalendar, "MAYDAY") calendar.holiday(belgiumCalendar, "EASTERMONDAY") calendar.holiday(belgiumCalendar, "WHITMONDAY") calendar.holiday(belgiumCalendar, "ASSUMPTION") calendar.holiday(belgiumCalendar, "ALLSAINTSDAY") calendar.holiday(belgiumCalendar, "ARMISTICE") q<-holidays(belgiumCalendar, "2021-01-01", 365.25*10, type="NextWorkingDay") plot(apply(q,1, max))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.