Description Usage Arguments Details Value Examples
Splice zoos together.
1 | spliceZoos(x, y)
|
x |
First input |
y |
First input |
Splices y
into x
, with x
taking precedence.
If y
only introduces a new series, then it works just like
a 'merge'.
spliceZoos
uses the input's column names to find common series,
then merges series "end-to-end" into a single series that may come from
both inputs. This is useful, for example, if series come from different
data sources but are different instances of the same underlying series.
If there are additional columns in the inputs that are not in-common, merges
those as normal. If there are not columns in-common, the function acts simply
as a regular merge.
A zoo
with the spliced output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(zoo)
dts1 <- seq(as.Date("2012-08-01"), as.Date("2013-09-30"), "days")
nr <- length(dts1)
z1 <- zoo(matrix(rnorm(nr*4), nr, 4), dts1)
colnames(z1) <- paste("S", 1:4, sep="")
dts4 <- seq(as.Date("2013-10-01"), as.Date("2013-11-01"), "days")
nr <- length(dts4)
z4 <- zoo(matrix(rnorm(nr), nrow=nr), dts4)
colnames(z4) <- 'S4'
allser <- spliceZoos(z1, z4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.