Learn R Programming

bizdays (version 0.1.4)

is.bizday: Checks if the given date is a business day.

Description

This function returns TRUE if the given date is a business day and FALSE otherwise.

Usage

is.bizday(dates, cal)

## S3 method for class 'character': is.bizday(dates, cal = bizdays.options$get("default.calendar"))

## S3 method for class 'POSIXct': is.bizday(dates, cal = bizdays.options$get("default.calendar"))

## S3 method for class 'POSIXlt': is.bizday(dates, cal = bizdays.options$get("default.calendar"))

## S3 method for class 'Date': is.bizday(dates, cal = bizdays.options$get("default.calendar"))

Arguments

dates
a date or a vector of dates to be checked
cal
an instance of Calendar

Examples

Run this code
data(holidaysANBIMA)
cal <- Calendar(holidaysANBIMA)
is.bizday("2013-01-02", cal)
# Using the default Calendar
dates <- seq(as.Date("2013-01-01"), as.Date("2013-01-05"), by="day")
is.bizday(dates)

Run the code above in your browser using DataLab