Learn R Programming

quantdates (version 1.0)

AddBusinessDays: AddBusinessDays

Description

Function to add a number of business days to a specific date. Currently the function work for returning values between 2000 and 2030.

Usage

AddBusinessDays(date = Sys.Date(), numDate, loc = "BOG")

Value

The output is the final date after adding the number of business dates to the initial date. If the initial date is a non-working date, the result of the function for numDate equal to 0 or 1 is the same.

Arguments

date

Initial date, the default is set to the date returned by Sys.Date().

numDate

Number of dates to be add (positive or negative).

loc

String that determines the location for business days. See details.

Author

Diego Jara

Details

loc refers to the location for business days:

  • NY for New York.

  • LDN for London.

  • NYLDN for the intersection of business days in New York and London.

  • BOG for Bogota.

  • BOGNY for the intersection of business days in Bogota and New York.

Examples

Run this code
# Date input as Date object
AddBusinessDays(date = Sys.Date(),numDate = 15,loc = 'BOG')

# Date input as character object
AddBusinessDays(date = as.character(Sys.Date()),numDate = 15,loc = 'BOG')

Run the code above in your browser using DataLab