Big-Data Calendar Time Series Plot

DESCRIPTION:

Function to plot a bigdata calendar time series, by aggregating or aligning and then calling the plot.timeSeries function. This is the method for the plot function for class bdTimeSeries.

This function requires the bigdata library section to be loaded.

USAGE:

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

REQUIRED ARGUMENTS:

x
a univariate or multivariate bdTimeSeries object.

OPTIONAL ARGUMENTS:

pos
Positions to aggregate or align the series to (passed into aggregateSeries or align).
FUN
Function to aggregate the series with (passed into aggregateSeries).
together
If T, pass all the columns of x into FUN together; if not, each column is aggregated separately. (passed into aggregateSeries).
by
If 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).
k.by
If pos is missing, the number of by units used to generate the sequence (passed into aggregateSeries or align).
week.align
If by is "weeks", week.align can be used to specify the weekday for the sequence (passed into aggregateSeries or align).
colnames
Column names to use for the aggregated series (default is to use the column names of x) (passed into aggregateSeries).
align
If T, use align to reduce the series. If F, use aggregateSeries.
how
how to treat unmatched positions when aligning, one of: "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).
error.how
what to do when, during aligning, there is an out of bounds error (can occur when how is "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
tolerance for matching positions when aligning. Positions which match within matchtol will not invoke any of the how argument methods (passed into align).
...
Plotting arguments for the plot.timeSeries function.
frame
the frame in which to parse the ... arguments. This argument can be used when plot is called from within another function if the plot titles are not coming out correctly.

VALUE:

the output of 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.

SIDE EFFECTS:

A plot will be produced on the active device, created by aggregating the input series with the given arguments, and then passing the resulting series (as a timeSeries object) to the plot.timeSeries function.

SEE ALSO:

, , .

EXAMPLES:

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