Learn R Programming

timeDate (version 290.83)

isBizday: Business and Holidays

Description

Tests if a date is a business day or not.

Usage

isBizday(x, holidays = holidayNYSE())
isHoliday(x, holidays = holidayNYSE())

Arguments

holidays
holiday dates from a holiday calendar. An object of class timeDate.
x
an object of class timeDate.

Value

  • the functions return logical vectors indicating if a date is a business day, or a holiday.

Examples

Run this code
## 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())]

Run the code above in your browser using DataLab