Merge time series or signal objects,
making a new object with all the columns of
the input objects, and some or all of the rows, depending on how their
positions match.
positions to align to, or
"union" to make a union of all input positions.
(Default argument values give an intersection of all the positions.)
how
after the positions to be aligned to are determined,
how tells
how to treat positions which are missing from the various input objects.
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". Default is
"drop" unless
pos="union",
in which case
"drop" makes no sense and the default is
"NA".
error.how
what to do when 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.
Default is
"drop" unless
pos="union",
in which case
"drop" makes no sense and the default is
"NA".
localzone
if T (all input positions must be calendar-based),
merge by matching/interpolating with all positions
in their local time zones, instead of with the absolute GMT times.
matchtol
tolerance for matching positions. Positions which match within
matchtol will
not invoke any of the
how argument methods.
suffixes
suffixes to be appended to column names which are duplicated between
the various input data objects. Default value is
paste(".", 1:nargs, sep = ""),
where
nargs is the total number of data arguments.
VALUE:
a new
series object containing all the columns of all the inputs, and
rows according to the alignment methods described above.
SEE ALSO:
,
,
,
,
.
EXAMPLES:
a <- signalSeries(pos=1:10, data=data.frame(a = 11:20, b = 5 * (1:10)))
b <- signalSeries(pos=5:14, data=data.frame(a = 11:20, b = 5 * (1:10)))
seriesMerge(a, b)
a <- timeSeries(pos=as(1:10, "timeDate"),
data=data.frame(a = 11:20, b = 5 * (1:10)))
b <- timeSeries(pos=as(5:14, "timeDate"),
data=data.frame(a = 11:20, b = 5 * (1:10)))
seriesMerge(a, b, pos="union")