timeSeq(from, to, by="days", length.out, k.by=1, align.by=F,
extend=F, week.align=NULL, holidays, exceptions,
additions, format, zone, bigdata=F)
REQUIRED ARGUMENTS:
At least one of
from or
to is required, plus
length.out, the
desired length of the resulting sequence; or both
from and
to in
which case if
length.out and
by are supplied,
length.out is ignored.
OPTIONAL ARGUMENTS:
from
starting value of the sequence, a
timeDate object (or number or
character string representing one).
to
ending value of the sequence, a
timeDate object (or number or
character string representing one).
by
spacing between successive values in the sequence. This can be
a
timeSpan,
timeRelative, or
numeric value,
in which case
k.by is ignored.
Alternatively, it can be one
of the following character strings:
"milliseconds",
"seconds",
"minutes",
"hours",
"days",
"weekdays",
"bizdays",
"weeks",
"months",
"quarters",
or
"years", giving the
time units of intervals between values in the sequence.
length.out
the length of the sequence, before additions and exceptions are included.
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. Ignored if
by is not a character string.
align.by
if
T, adjust the sequence so that each element is on a whole number
of the
by * k.by units; e.g., if the units are 2 months, make the sequence
be only on the first of January, March, etc. Ignored if
by is not a character string.
extend
if
T and
align.by is also
T, instead of making the entire sequence lie
between
from and
to, instead make it extend just past
from and
to
to the next aligned values. E.g., if
from is January 15th and the sequence
is by 1 month units, if
extend is
F the sequence will start on
February 1st, and if it is
T, January 1st. Ignored if
by is not a character string.
week.align
if
by is
"weeks",
you can supply a character
string (or a number, 0 to 6 with 0 being Sunday)
to specify a weekday to use. The character string must
be sufficient to make a unique case-insensitive match to the strings
in
options("time.day.name").
The sequence is then adjusted so that all its elements fall on the
given weekday; if
align.by
is
T, then it will also be adjusted
to start at midnight. In either case,
the
extend argument is used to decide which
direction to adjust the day. This argument is ignored if
by is not a character string, or if it
is not
"weeks".
holidays
holidays for business day sequences (ignored if
by is not
a character string).
exceptions
event object giving time periods when sequence should not have
any values. These are applied after the sequence is created from
from/to/by/length.out.
additions
additional times/dates to put in the sequence.
format
time/date output format for printing.
zone
time zone for the sequence.
bigdata
a logical value; if
TRUE, an object of type
bdTimeDate is returned.
Otherwise, a
timeData object is returned. This argument can be used only if the bigdata library section has been loaded.
VALUE:
a time/date object as defined by the arguments.
DETAILS:
SEE ALSO:
,
,
,
,
,
EXAMPLES:
timeSeq("1/1/1992", "1/10/1992")
timeSeq("1/1/1992", "12/1/1992", by = "months")
timeSeq("1/3/1992", "12/5/1992", by = "months", align.by=T)
timeSeq("1/3/1992", "12/5/1992", by = "months", align.by=T, extend=T)
timeSeq("1/1/1992", "1/31/1992", by = "weeks", align.by=T,
week.align="Mon")
timeSeq("1/1/1992", "12/31/1992", by="weekdays", exceptions=holidays(1992))
timeSeq("1/1/1992", "1/1/1995", by="months", exceptions=timeEvent("1/1/1993", "12/31/1993"))
# subtract one day from a first-of-month sequence to create # an end-of-month sequence
timeSeq(from = "2/1/2003", to = "1/1/2004", by = "months" ) - 1
[1] 01/31/2003 02/28/2003 03/31/2003 04/30/2003 05/31/2003 06/30/2003 [7] 07/31/2003 08/31/2003 09/30/2003 10/31/2003 11/30/2003 12/31/2003