[Returnanalytics-commits] r2228 - pkg/PortfolioAnalytics/sandbox/attribution/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Aug 9 16:16:17 CEST 2012


Author: ababii
Date: 2012-08-09 16:16:17 +0200 (Thu, 09 Aug 2012)
New Revision: 2228

Modified:
   pkg/PortfolioAnalytics/sandbox/attribution/R/AcctReturns.R
Log:
- fixed bug with the absent quotations in the methods

Modified: pkg/PortfolioAnalytics/sandbox/attribution/R/AcctReturns.R
===================================================================
--- pkg/PortfolioAnalytics/sandbox/attribution/R/AcctReturns.R	2012-08-09 13:48:41 UTC (rev 2227)
+++ pkg/PortfolioAnalytics/sandbox/attribution/R/AcctReturns.R	2012-08-09 14:16:17 UTC (rev 2228)
@@ -100,12 +100,12 @@
     V = initEq + reclass(rowSums(table), table)                  # Account values
     method = method[1]
     
-    if (method == timeweighted){
+    if (method == "timeweighted"){
       # Time-weighted returns
       returns = V  / (lag(V) + CF) - 1
     }
     
-    if (method == dietz){
+    if (method == "dietz"){
       # Linked modified Dietz
       C = apply.monthly(CF, sum)   # total monthly cashflow
       V = apply.monthly(V, first)  # monthly account values



More information about the Returnanalytics-commits mailing list