Description Usage Arguments Details Examples
The Calendar
stores all information necessary to compute business days.
This works like a helper class for many of bizdays
' methods.
1 2 3 |
holidays |
a vector of Dates which contains the holidays |
name |
calendar's name |
dib |
a single numeric variable which indicates the amount of days
within a year ( |
start.date |
the date which the calendar starts |
end.date |
the date which the calendar ends |
The arguments start.date
and end.date
can be set but once they aren't and holidays
is set, start.date
is defined to min(holidays)
and end.date
to max(holidays)
.
If holidays isn't set start.date
is set to '1970-01-01'
and end.date
to '2071-01-01'
.
weekdays
is controversial but it is only a sequence of nonworking weekdays.
In the great majority of situations it refers to the weekend but it is also possible defining
it differently.
weekdays
accepts a character
sequence with lower case weekdays (
sunday
, monday
, thuesday
, wednesday
, thursday
,
friday
, saturday
).
This argument defaults to NULL
because the default intended behavior for
Calendar
returns an actual calendar, so calling Calendar(dib=365)
returns a actual/365 calendar and Calendar(dib=360)
and actual/360
(for more calendars see Day Count Convention)
To define the weekend as the nonworking weekdays one could simply
use weekdays=c("saturday", "sunday")
.
dib
reffers to days in base and represents the amount of days within a year.
That is necessary for defining Day Count Conventions and for accounting annualized periods
(see bizyears
).
The arguments adjust.from
and adjust.to
are used to adjust bizdays
' arguments
from
and to
, respectively.
These arguments need to be adjusted when nonworking days are provided.
The default behavior, setting adjust.from=adjust.previous
and adjust.to=adjust.next
,
works like Excel's function NETWORKDAYS, since that is fairly used by a great number of practitioners.
Calendar
doesn't have to be named, but it helps identifying the calendars once many are instantiated.
You name a Calendar
by setting the argument name
.
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.