bdTimeSeries
object from positions and data, or
return an empty
bdTimeSeries
.
This function requires the bigdata library section to be loaded.
bdTimeSeries() bdTimeSeries(data, positions., units., from=timeCalendar(d=1,m=1,y=1960), by="days", k.by=1, align.by=F, week.align=NULL) as.bdTimeSeries(x) is.bdTimeSeries(x)
data
must be supplied, unless the function is
called with no arguments.
timeSeries
object.
Any S-PLUS object for
is.bdTimeSeries
.
bdFrame
.
bdTimeDate
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 sequence 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.
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"
.
bdTimeSeries
object constructed from the input.
If no arguments are supplied, the default (empty)
bdTimeSeries
object
is returned. Otherwise, a
bdTimeSeries
object is created with the
given
positions
and
data
, and
units
if they are supplied.
bdTimeSeries(data.frame(x = 11:20, y = 21:30), timeCalendar(1:10), units = c("USD", "DEM")) bdTimeSeries(data= data.frame(x = 11:20, y = 21:30), from="1/1/98" )