Learn R Programming

bizdays (version 0.1.5)

add.bizdays: Adds n business days to the given dates.

Description

This function returns the given dates offset by the given amount of n business days.

Usage

add.bizdays(dates, n, cal)

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

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

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

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

Arguments

dates
a date or a vector of dates to be offset
n
the amount of business days to add
cal
an instance of Calendar

Examples

Run this code
data(holidaysANBIMA)
cal <- Calendar(holidaysANBIMA)
add.bizdays("2013-01-02", 5, cal)
dates <- seq(as.Date("2013-01-01"), as.Date("2013-01-05"), by="day")
add.bizdays(dates, 1, cal)

Run the code above in your browser using DataLab