business.days: Extract Business Days

Description Usage Arguments Value Examples

View source: R/date.utils.r

Description

Extract Business Days

Usage

1
2
business.days(from = Sys.Date(), to = as.Date(from) + 31, holidays = NULL,
  dates = NULL, calendar = NULL, return.index = F)

Arguments

from

start date (ignored if dates are provided)

to

start date (ignored / optional if dates are provided)

holidays

list of holidays, defaults to NULL

dates

dates, defaults to NULL

calendar

RQuantLib calendar name to use to determine business days, defaults to NULL

return.index

flag to return index of valid dates instead of dates, defaults to FALSE

Value

business days

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
library(RQuantLib)
from = as.Date('10Jun2013','%d%b%Y')
to = as.Date('10Jan2014','%d%b%Y')
holidays = getHolidayList('UnitedStates/NYSE', from, to)
holidays = getHolidayList('Canada/TSX', from, to)
business.days(from, to, holidays = holidays)

business.days(dates = dates, calendar = 'UnitedStates/NYSE')

## End(Not run)

systematicinvestor/SIT.date documentation built on March 5, 2020, 10:22 a.m.