[Returnanalytics-commits] r2970 - pkg/PerformanceAnalytics/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Sep 2 14:46:24 CEST 2013
Author: ababii
Date: 2013-09-02 14:46:24 +0200 (Mon, 02 Sep 2013)
New Revision: 2970
Modified:
pkg/PerformanceAnalytics/R/Return.portfolio.R
Log:
- Fix a bag with conversion of the wealth index to the xts. The function as.xts was replaced by reclass.
Modified: pkg/PerformanceAnalytics/R/Return.portfolio.R
===================================================================
--- pkg/PerformanceAnalytics/R/Return.portfolio.R 2013-09-01 21:28:27 UTC (rev 2969)
+++ pkg/PerformanceAnalytics/R/Return.portfolio.R 2013-09-02 12:46:24 UTC (rev 2970)
@@ -180,7 +180,7 @@
for (col in colnames(weights)){
wealthindex.weighted[,col]=weights[,col]*wealthindex.assets[,col]
}
- wealthindex=as.xts(apply(wealthindex.weighted,1,sum))
+ wealthindex=reclass(apply(wealthindex.weighted,1,sum), R)
result = wealthindex
result[2:length(result)] = result[2:length(result)] /
lag(result)[2:length(result)] - 1
More information about the Returnanalytics-commits
mailing list