Learn R Programming

bizdays (version 0.1.4)

adjust.next: Adjusts the date to the next business day

Description

Moves the given date to the next business day, once it is a non-business day.

Usage

adjust.next(dates, cal)

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

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

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

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

adjust.previous(dates, cal)

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

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

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

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

Arguments

dates
a vector of dates to be adjusted
cal
an instance of Calendar

Examples

Run this code
data(holidaysANBIMA)
cal <- Calendar(holidaysANBIMA)
adjust.next("2013-01-01", cal)
adjust.previous("2013-01-01", cal)

Run the code above in your browser using DataLab