holidays | R Documentation |
Generates a collection of holidays.
holidays(years, type = "USFederal", move = FALSE)
years |
the years for which to generate holidays. |
type |
the names of holidays to generate. |
move |
a logical value. If |
This function calls the holiday.xxx
functions,
where xxx
takes on the value of each of the strings
in the type
argument.
If these functions do not exist, an error occurs.
After calling the holiday.xxx
functions,
holidays
calls holiday.nearest.weekday
if move
is TRUE
. This moves the holidays so they occur
on weekdays. move
can also be given as a logical vector,
in which case each element applies to the corresponding element of type
.
returns a time/date object containing the specified holidays, in chronological order.
The time of day in the returned value is midnight in the time zone
given by timeDateOptions("time.zone")
.
holiday.AllSaints
, holiday.nearest.weekday
,
holiday.fixed
.
## Generate Christmas, New Years, and Veterans day, moving Christmas ## and New Years to the nearest weekday holidays(1994:2005, c("Christmas", "NewYears", "Veterans"), c(TRUE, TRUE, FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.