Free Access Week-  Data Engineering + BI
Data engineering and BI courses are free!
Free AI Access Week from June 2-8

bizdays (version 0.1.4)

add: 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(dates, n, cal)

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

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

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

## S3 method for class 'Date': add(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("2013-01-02", 5, cal)
dates <- seq(as.Date("2013-01-01"), as.Date("2013-01-05"), by="day")
add(dates, 1, cal)

Run the code above in your browser using DataLab