timeSeries Class
timeSeries object from positions and data, or
return an empty
timeSeries.
timeSeries()
timeSeries(data, positions., units., from=timeCalendar(d=1,m=1,y=1960),
by="days", k.by=1, align.by=F, week.align=NULL)
data must be supplied, unless the function is
called with no arguments.
as.rectangular function.
timeDate or
timeSequence object to use as positions/time values;
if missing, it is constructed from
from and
by.
positions. is missing, construct positions for the series
as a
timeSequence starting from
from, which must be
a
timeDate object (or number or character string representing one).
positions. is missing: gives the
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.
positions. is missing: a
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.
positions. is missing:
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.
positions. is missing:
if not
NULL, and
align.by is
T, and
by is
"weeks",
you can supply a character
string (or a number, 0 to 6 with 0 being Sunday)
to specify a weekday to align to. The character string must
be sufficient to make a unique case-insensitive match to the strings
in
options("time.day.name"). Ignored if
by is not a character string.
If no arguments are supplied, the default (empty)
timeSeries object
is returned. Otherwise, a
timeSeries object is created with the
given
positions and
data, and
units if they are supplied.
timeSeries()
timeSeries(data.frame(x = 11:20, y = 21:30), timeCalendar(1:10),
units = c("USD", "DEM"))
timeSeries(data= data.frame(x = 11:20, y = 21:30), from="1/1/98" )