plot.timeSeries
function.
This is the method
for the
plot
function for
class
bdTimeSeries
.
This function requires the bigdata library section to be loaded.
plot(x, pos, FUN = function(x) mean(x, na.rm = T), together = F, by, k.by = 1, week.align = NULL, colnames, align=F, how="before", error.how="drop", matchtol=0, ..., frame=sys.nframe())
bdTimeSeries
object.
aggregateSeries
or
align
).
aggregateSeries
).
T
, pass all the columns of
x
into
FUN
together; if not, each
column is aggregated separately.
(passed into
aggregateSeries
).
pos
is missing, aggregate or align using
a sequence spaced by
by
. If
by
is missing, the function chooses
a value based on the range of positions of the series
(passed into
aggregateSeries
or
align
).
pos
is missing, the number of
by
units used to generate the sequence
(passed into
aggregateSeries
or
align
).
by
is
"weeks"
,
week.align
can be used to specify the weekday
for the sequence
(passed into
aggregateSeries
or
align
).
x
)
(passed into
aggregateSeries
).
"NA"
- insert a row of
NA
;
"drop"
- drop that position entirely;
"nearest"
- use the row with
the nearest position;
"before"
- use the data from the row whose position
is just before the unmatched position;
"after"
- use the data from
the row whose position is
just after the unmatched position;
"interp"
- interpolate linearly
between
"before"
and
"after"
(passed into
align
).
"before"
,
"after"
, or
"interp"
), one of:
"NA"
- insert a row of
NA
;
"drop"
- drop that position
entirely;
"nearest"
- use the row with the nearest position.
(passed into
align
).
matchtol
will
not invoke any of the
how
argument methods
(passed into
align
).
plot.timeSeries
function.
...
arguments.
This argument can be used when
plot
is called from within another function if the plot titles are not
coming out correctly.
axis.time
which has the parameters for the time
axis, including the mapping from user coordinates to plot coordinates.
This is needed to add to the plot or identify points from the plot.
timeSeries
object) to the
plot.timeSeries
function.
## plot the Dow Jones Industrial Average closing prices x <- bdTimeSeries(djia@data[,"close", drop=F], djia@positions) x@title <- djia@title plot(x) ## plot a monthly high/low/open/close plot of the Dow's closing price plot(x, by = "months", FUN = hloc, plot.type = "hloc", colnames = c("high", "low", "open", "close")) ## plot using alignment instead of aggregation plot(x, by = "months", align=T)