Let's say I do the following:
create.calendar(name='MyCalendar', weekdays=c('sunday', 'saturday'),
adjust.from=adjust.next, adjust.to=adjust.previous)
bizdays.options$set(default.calendar='MyCalendar')
Now, I want to calculate the number of business days between 2020-11-23 and 2020-11-27 (including November 23rd and 27th).
However, when I use bizdays()
:
bizdays("2020-11-23", "2020-11-27")
The output is "4". I would like to get a "5" to include all days. How can I achieve this?
Thanks!
We want to include
from
only if it's a business day i.eis.bizday(from)==TRUE
thus we can make up the following function:Or if we set the financial flag to
FALSE
in the calendar: