national_calendar: Create a National Calendar

View source: R/calendars.R

national_calendarR Documentation

Create a National Calendar

Description

Will create a calendar as a list of days corresponding to the required holidays. The holidays have to be generated by one of these functions: fixed_day(), fixed_week_day(), easter_day(), special_day() or single_day().

Usage

national_calendar(days, mean_correction = TRUE)

Arguments

days

list of holidays to be taken into account in the calendar

mean_correction

TRUE if the variables generated by this calendar will contain long term mean corrections (default). FALSE otherwise.

Value

returns an object of class c("JD3_CALENDAR","JD3_CALENDARDEFINITION")

References

More information on calendar correction in JDemetra+ online documentation: https://jdemetra-new-documentation.netlify.app/

See Also

chained_calendar, weighted_calendar

Examples

# Fictional calendar using all possibilities to set the required holidays
MyCalendar <- national_calendar(list(
    fixed_day(7, 21),
    special_day("NEWYEAR"),
    special_day("CHRISTMAS"),
    fixed_week_day(7, 2, 3), # second Wednesday of July
    special_day("MAYDAY"),
    easter_day(1), # Easter Monday
    easter_day(-2), # Good Friday
    single_day("2001-09-11"), # appearing once
    special_day("ASCENSION"),
    easter_day(
        offset = 60, julian = FALSE, weight = 0.5,
        validity = list(start = "2000-01-01", end = "2020-12-01")
    ), # Corpus Christi
    special_day("WHITMONDAY"),
    special_day("ASSUMPTION"),
    special_day("ALLSAINTSDAY"),
    special_day("ARMISTICE")
))

palatej/rjd3toolkit documentation built on Oct. 30, 2024, 10:46 p.m.