xtsMultiMerge: Merge multiple xts objects without going through zoo...

Description Usage Arguments Value Examples

View source: R/xtsMultiMerge.R

Description

This function takes a list of xts objects and joins them, without having to manually convert each to zoo, applying merge.zoo, and then converting back to xts format. Just supply a list of xts objects and specify the join method and the function returns a merged xts object.

Usage

1
xtsMultiMerge(xtslst, join = "inner")

Arguments

join

the type of database join to use in merging the xts objects.

xtslist

a list of xts objects.

Value

a merged xts object following the database join rules specified.

Examples

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)

xtsMultiMerge(list(short.xts, long.xts))

gtog/dMisc documentation built on May 17, 2019, 8:57 a.m.