Re: [R] multivariate xts merge question

2012-04-27 Thread R. Michael Weylandt
If I understand what you are looking to do, this might be the most efficient: y < - apply(x,1,function(y,ns) procState(y,ns), colnames(x)) y <- as.xts(do.call(rbind, y)) merge(x, y) But you might benefit from looking at zoo::rollapplyr() rather than apply -- I think the result will be an xts (or

[R] multivariate xts merge question

2012-04-27 Thread Soo Sun Park
Hi, I have an xts starting with a number of columns (currency pairs see below), then I add new ones which are derived from existing ones (like adding the moving average of a column) by merging the new columns one by one. These get the name of the column they are calculated from concatenated with "