Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

calendar-isBizday

Business and Holidays


Description

Tests if a date is a business day or not.

Usage

isBizday(x, holidays = holidayNYSE(), wday = 1:5)
isHoliday(x, holidays = holidayNYSE(), wday = 1:5)

Arguments

x

an object of class timeDate.

holidays

holiday dates from a holiday calendar. An object of class timeDate.

wday

Specify which days should be considered as weekdays. By default from Mondays to Fridays.

Value

a logical vector of the same length as x indicating if a date is a business day, or a holiday, respectively.

Examples

## Dates in April, currentYear:
   currentYear = getRmetricsOptions("currentYear")
   tS = timeSequence(
      from = paste(currentYear, "-03-01", sep = ""),
      to = paste(currentYear, "-04-30", sep = ""))
   tS

## Subset Business Days at NYSE:
   holidayNYSE()
   isBizday(tS, holidayNYSE())
   tS[isBizday(tS, holidayNYSE())]

timeDate

Rmetrics - Chronological and Calendar Objects

v3043.102
GPL (>= 2)
Authors
Diethelm Wuertz [aut], Tobias Setz [cre], Yohan Chalabi [ctb], Martin Maechler [ctb], Joe W. Byers [ctb]
Initial release
2018-02-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.