Description Usage Arguments Details Value Note
Functions that know about Federal and FRB (Federal Reserve Board) holidays.
1 2 3 4 5 6 7 8 9 10 11 12 13 | nextBusinessDay(x, holidays = NULL, goodFriday = F, board = F, inaug = board)
previousBusinessDay(x, holidays = NULL, goodFriday = F, board = F, inaug = board)
isHoliday(x, goodFriday = F, board = F, inaug = board, businessOnly = T)
isBusinessDay(x, ...)
isGoodFriday(x)
isEaster(x)
holidays(years, goodFriday = F, board = F, inaug = board, businessOnly = T)
federalHolidays(years, board = F, businessOnly = T)
goodFriday(years)
easter(years)
inaugurationDay(years)
holidaysBetween(startTi, endTi, goodFriday = F, board = F, inaug = board,
businessOnly = T)
|
x |
a |
holidays |
a vector of holidays (in yyyymmdd form) to skip over, or
|
goodFriday |
if |
board |
if |
inaug |
if |
businessOnly |
if |
... |
arguments passed on to |
years |
numeric vector of 4 digit years |
startTi |
a daily |
endTi |
a daily |
Federal law defines 10 holidays. Four of them, NewYears, Independence, Veterans and Christmas, fall on the same date every year. The other six fall on particular days of the week and months (MLK, Presidents, Memorial, Labor, Columbus, and Thanksgiving).
If one of the four fixed-date holidays falls on a Sunday, the federal holiday is celebrated the next day (Monday). If it falls on a Saturday, the preceding day (Friday) is a holiday for the Federal Reserve Board, but not for the Reserve Banks and the banking system as a whole.
Presidential Inauguration day is a Federal holiday only in the DC
area, and then only if it falls on a weekday, so it is not included in
the holidays returned by federalHolidays
, but it can be
included in several of the other functions by setting the inaug
argument to TRUE
.
The function isBusinessDay
returns TRUE
for x
if
and only if x
is not a holiday, a Saturday or a Sunday.
nextBusinessDay
and previousBusinessDay
return
"business" frequency ti
objects.
isHoliday
, isGoodFriday
, isEaster
and isBusinessDay
return
Boolean vectors as long as x
.
easter
and goodFriday
return numeric vectors of yyyymmdd
dates of the appropiate holidays for each year in the years
argument.
inaugurationDay
returns a numeric vector of yyyymmdd dates of
U.S. Presidential Inauguration Days, if any, that fall in the years
given in the years
argument.
federalHolidays
returns a numeric vector of yyyymmdd dates
for the federal holidays for each year in years
. The
names
attribute of the returned vector contains the holiday
names.
holidays
returns a vector like federalHolidays
does.
The only difference between the two functions is that holidays
has the option of including Good Fridays.
holidaysBetween
returns a vector of yyyymmdd dates for holidays
that fall within the time spanned by [startTi, endTi]
.
The algorithm for finding Easter dates was found somewhere on the web (I don't remember where) and is unbelievably complex. It would probably be simpler to just celebrate the home opener of the Cleveland Indians instead.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.