Description Usage Arguments Value Examples
This function aligns two xts objects so that they will have the same date indexing. The default join method is "inner." See the documentation for merge.xts for different join methods, although this operation probably only makes sense using an "inner" join.
1 | xtsAlign(target, match.to, join = "inner")
|
target |
the xts object you would like to modify. |
match.to |
the xts object you would like to emulate or align to. |
join |
the type of database join to use in matching. Default is "inner". Other methods could lead to strange results. |
an xts object whose date index is now aligned with match.to
.
1 2 3 4 5 6 7 8 9 | dts.long <- seq(Sys.Date()-49, Sys.Date(), 1)
ret.long <- matrix(rnorm(50),ncol = 1) / 100
long.xts <- xts(ret.long, dts.long)
dts.short <- seq(Sys.Date()-9, Sys.Date(), 1)
ret.short <- matrix(rnorm(10),ncol = 1) / 100
short.xts <- xts(ret.short, dts.short)
xtsAlign(target = long.xts, match.to = short.xts)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.