Time Sequence Class

DESCRIPTION:

The timeSequence class is a compact representation of a time/date vector in an arithemetic sequence.

SLOTS:

ARGUMENTS:

from
( timeDate) the start of the sequence.
to
( timeDate) the end of the sequence.
by
( timeInterval) the increment for the sequence.
length
( integer) the length of the sequence.
exceptions
( event) time periods to remove from the sequence.
additions
( positionsCalendar) times/dates to add to the sequence.
format
( character) the time/date output format for sequence display.
time.zone
( character) the time zone for the sequence.

DETAILS:

The timeSequence class extends the positionsCalendar class. Valid timeSequence objects must contain a single non- NA value in at least three of the from, to, by, and length slots. If all four are present, the length slot will be ignored, and a warning message will be generated when the sequence is used. If length is present and not being ignored, it must be non-negative [a zero-length sequence is equivalent to timeDate()]. Otherwise, adding by to from must go towards to in order to have a valid sequence. The default sequence [generated by calling timeSequence() or new("timeSequence") ] has length 0. A timeSequence can be coerced to timeDate using as, and regularly spaced times/dates (or time/date vectors spaced by regular numbers of months) can be coerced to timeSequence using as, [this will fail if the input is not a regular sequence within a tolerance given by options("ts.eps")]. Most operations that work for timeDate objects also work on timeSequence objects (e.g. mathematical functions, arithmetic, comparison operators, subscripting), by first coercing to a time/date vector; they therefore do not return timeSequence objects. Because of this, it is more efficient to coerce a timeSequence to timeDate using as before performing an extended set of calculations on the original object, rather than coercing for each operation.

SEE ALSO:

function.