私は同様の経過時間で実行することを期待cbind.xts
し、実行します。do.call(cbind.xts)
R2.11、R2.14もそうでした。
R2.15.2 およびxts 0.8-8 の場合、do.call(cbind.xts,...)
バリアントの実行速度が大幅に低下し、以前のコードが効果的に機能しなくなります。
以下のコメントで Josh Ulrich が指摘しているように、xtsパッケージのメンテナーはこの問題を認識しています。それまでの間、便利な回避策はありますか?
再現可能な例:
library(xts)
secs <- function (rows, from = as.character(Sys.time()), cols = 1, by = 1)
{
deltas <- seq(from = 0, by = by, length.out = rows)
nacol <- matrix(data = NA, ncol = cols, nrow = rows)
xts(x = nacol, order.by = strptime(from, format = "%Y-%m-%d %X") +
deltas)
}
n <- 20
d1 <- secs(rows=n*100,cols=n)
d2 <- secs(rows=n*100,cols=n)
system.time(cbind.xts(d1,d2))
対
system.time(do.call(cbind.xts, list(d1,d2)))