Constructor Function for timeSeries Class

DESCRIPTION:

Construct a timeSeries object from positions and data, or return an empty timeSeries.

USAGE:

timeSeries() 
timeSeries(data, positions., units., from=timeCalendar(d=1,m=1,y=1960),  
           by="days", k.by=1, align.by=F, week.align=NULL) 

REQUIRED ARGUMENTS:

data must be supplied, unless the function is called with no arguments.

OPTIONAL ARGUMENTS:

data
variable data, which will be converted to a rectangular object with the as.rectangular function.
positions.
timeDate or timeSequence object to use as positions/time values; if missing, it is constructed from from and by.
units
units for variable data.
from
if 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).
by
used to construct positions if 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.
k.by
used to construct positions if 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.
align.by
used to construct positions if 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.
week.align
used to construct positions if 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.

VALUE:

a calendar time series object constructed from the input.

DETAILS:

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.

SEE ALSO:

, . , , .

EXAMPLES:

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" )