hldy_christmas: Christmas

Description Usage Arguments Value Examples

View source: R/hldy-christmas.R

Description

hldy_christmas() is a holiday for Christmas, December 25th.

Usage

1
2
3
4
5
6
hldy_christmas(
  since = "1900-01-01",
  until = "2100-01-01",
  adjust_on = NULL,
  adjustment = NULL
)

Arguments

since

[Date(1)]

The lower bound on where to begin looking for the holiday.

until

[Date(1)]

The upper bound on where to end looking for the holiday.

adjust_on

[NULL / rschedule]

If NULL, no adjustment is made.

Otherwise, an rschedule that defines when an adjustment should be made. For example, set to an rschedule for "on weekends", and supply an adjustment of adj_nearest() to roll holidays that fall on a weekend to the nearest weekday.

adjustment

[NULL / function]

If NULL, no adjustment is made to the holiday.

Otherwise, an adjustment function to apply to problematic dates. Typically one of the pre-existing adjustment functions, like almanac::adj_nearest().

Value

A rholiday.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(almanac)

alma_search("1990-01-01", "1995-01-01", hldy_christmas())

# Adjust weekend Christmas to nearest weekday
adjust_on <- weekly() %>%
  recur_on_weekends()

christmas_adjusted <- hldy_christmas(
  adjust_on = adjust_on,
  adjustment = adj_nearest
)

alma_search("1990-01-01", "1995-01-01", christmas_adjusted)

DavisVaughan/vacation documentation built on May 2, 2020, 11:07 a.m.