The holiday_aus function shifts Boxing Day (the public holiday after Christmas Day) when it falls on a Sunday to the following Monday, however when Boxing Day falls on a Sunday, Christmas Day will fall on the Saturday, and the following Monday will be the Christmas Day public holiday, and the following Tuesday will be the Boxing Day Public Holiday.
Hence in holiday.r the statement below:
boxing <- as_date(ifelse(
boxing_wday == 1, # Sunday
boxing + days(1), # shift to next Monday
boxing
))
Should be:
boxing <- as_date(ifelse(
boxing_wday == 1, # Sunday
boxing + days(2), # shift to next Tuesday
boxing
))
The holiday_aus function shifts Boxing Day (the public holiday after Christmas Day) when it falls on a Sunday to the following Monday, however when Boxing Day falls on a Sunday, Christmas Day will fall on the Saturday, and the following Monday will be the Christmas Day public holiday, and the following Tuesday will be the Boxing Day Public Holiday.
Hence in holiday.r the statement below: boxing <- as_date(ifelse( boxing_wday == 1, # Sunday boxing + days(1), # shift to next Monday boxing ))
Should be: boxing <- as_date(ifelse( boxing_wday == 1, # Sunday boxing + days(2), # shift to next Tuesday boxing ))
As it happens 2021 is such a year, see: https://info.australia.gov.au/about-australia/special-dates-and-events/public-holidays
The existing function has both Christmas Day and Boxing Day falling on the 27th, per the link above the Boxing Day falls on the 28th: