Description Usage Arguments Value Examples
Generate a sequence of dates. Based on seq.Date
, but adds support for business day and holiday sequencing.
dateSeq()
is a generic, with
methods for character
, Date
, POSIXct
, and POSIXlt
.
1 2 3 4 |
from |
starting value of the sequence, a |
to |
ending value of the sequence, a |
year |
an alternative to supplying |
by |
spacing between successive values in the sequence. Can be one of An alternative way to specify |
k.by |
non-zero integer giving the width of the interval between consecutive values in the sequence in terms of the units given in by. |
length.out |
the length of the sequence, before additions and exceptions are included. |
holidays |
character string describing the holidays to exclude from the sequence when |
align.by |
if TRUE, adjust the sequence so that each element is on a whole number of the |
extend |
if TRUE and align.by is also TRUE, instead of making the entire sequence lie between from and to, make it extend just past from and to to the next aligned values. |
range |
a two-element character or |
week.align |
if |
A vector of dates.
The class of the returned value is the same as the class of from
for character
, Date
, POSIXct
, and
POSIXlt
. For from
of other classes, the class of the
returned value is Date
, but this may change in the future.
1 2 3 4 5 6 7 | dateSeq("2008-12-20", "2009-1-10")
dateSeq("2008-12-20", "2009-1-10", by = "days", k.by = 2)
library(Holidays)
dateSeq("2008-12-20", "2009-1-10", by = "bizdays", holidays = "NYSEC")
dateSeq(from = "1960-01-01", to = "1960-01-20", by = "weeks", week.align
= 0, extend = TRUE)
dateSeq(from = "2000/01/14", length.out = 5, by = "bizdays", holidays = 'NYSEC')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.