AddBusinessDays: AddBusinessDays

View source: R/DateManipulation.R

AddBusinessDaysR Documentation

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")

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.

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.

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.

Author(s)

Diego Jara and Juan Pablo Bermudez

Examples

# 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')


quantdates documentation built on July 4, 2024, 9:07 a.m.