[Blotter-commits] r47 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jan 6 19:45:49 CET 2009
Author: jryan
Date: 2009-01-06 19:45:49 +0100 (Tue, 06 Jan 2009)
New Revision: 47
Modified:
pkg/R/updateAcct.R
Log:
changed as.xts calls that used order.by to xts() calls
Modified: pkg/R/updateAcct.R
===================================================================
--- pkg/R/updateAcct.R 2008-12-31 05:26:24 UTC (rev 46)
+++ pkg/R/updateAcct.R 2009-01-06 18:45:49 UTC (rev 47)
@@ -33,7 +33,7 @@
# Append the portfolio summary data to the portfolio slot
for(i in 1:length(Portfolios)){
Portfolio = get(Portfolios[i])
- row = as.xts(calcPortfSummary(Portfolio, Dates[d]), order.by=as.Date(Dates[d])) ## comes back as zoo?
+ row = xts(calcPortfSummary(Portfolio, Dates[d]), order.by=as.Date(Dates[d])) ## comes back as zoo?
Account[[i+1]] = rbind(Account[[i+1]],row)
}
@@ -42,7 +42,7 @@
RealizedPL = as.numeric(calcAcctAttr(Account, 'Realized.PL', Dates[d]))
UnrealizedPL = as.numeric(calcAcctAttr(Account, 'Unrealized.PL', Dates[d]))
TradingPL = as.numeric(calcAcctAttr(Account, 'Trading.PL', Dates[d]))
- row = as.xts(t(c(0, 0, TxnFees, RealizedPL, UnrealizedPL, 0, TradingPL, 0, 0, 0)), order.by=as.Date(Dates[d]))
+ row = xts(t(c(0, 0, TxnFees, RealizedPL, UnrealizedPL, 0, TradingPL, 0, 0, 0)), order.by=as.Date(Dates[d]))
colnames(row) = c('Additions', 'Withdrawals', 'Txn.Fees', 'Realized.PL', 'Unrealized.PL', 'Int.Income', 'Trading.PL', 'Advisory.Fees', 'Net.Performance', 'End.Eq')
Account[['TOTAL']] <- rbind(Account[['TOTAL']], row)
# This function does not calculate End.Eq
More information about the Blotter-commits
mailing list