Learn R Programming

quantdates (version 2.0.4)

AddBusinessDays: AddBusinessDays

Description

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

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 and Juan Pablo Bermudez

Details

loc refers to the location for business days:

  • NY for New York Stock Exchange Market.

  • NYGB for New York Government Bonds Market.

  • LDN for London.

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

  • NYGBLDN for the intersection of business days in New York Government Bond and London.

  • BOG for Bogota.

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

  • BOGNYGB for the intersection of business days in Bogota and New York Government Bond.

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