[Blotter-commits] r1658 - pkg/blotter/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Dec 1 17:02:39 CET 2014
Author: bodanker
Date: 2014-12-01 17:02:39 +0100 (Mon, 01 Dec 2014)
New Revision: 1658
Modified:
pkg/blotter/R/updateAcct.R
Log:
- Fix #5983; thanks to Alexios Ghalanos for the report/patch
Modified: pkg/blotter/R/updateAcct.R
===================================================================
--- pkg/blotter/R/updateAcct.R 2014-11-29 13:39:24 UTC (rev 1657)
+++ pkg/blotter/R/updateAcct.R 2014-12-01 16:02:39 UTC (rev 1658)
@@ -111,7 +111,7 @@
},
Additions = {
result = if(on=="none")
- as.xts(sum(Account$Additions[paste("::",obsDates, sep="")]), order.by=index(table))
+ as.xts(sum(Account$Additions[obsDates]), order.by=index(table))
else{
if(length(Account$Additions[obsDates])>0) # catch empty sets
period.apply(Account$Additions[obsDates], endpoints(Account$Additions[obsDates], on=on), sum) # aggregates multiple account txns
@@ -121,7 +121,7 @@
},
Withdrawals = {
result = if(on=="none")
- as.xts(sum(Account$Withdrawals[paste("::",obsDates, sep="")]), order.by=index(table))
+ as.xts(sum(Account$Withdrawals[obsDates]), order.by=index(table))
else{
if(length(Account$Withdrawals[obsDates])>0) # catch empty sets
period.apply(Account$Withdrawals[obsDates], endpoints(Account$Withdrawals[obsDates], on=periodicity(table)$units), sum)
@@ -131,7 +131,7 @@
},
Interest = {
result = if(on=="none")
- as.xts(sum(Account$Interest[paste("::",obsDates, sep="")]),, order.by=index(table))
+ as.xts(sum(Account$Interest[obsDates]), order.by=index(table))
else{
if(length(Account$Interest[obsDates])>0) # catch empty sets
period.apply(Account$Interest[obsDates], endpoints(Account$Interest[obsDates], on=periodicity(table)$units), sum)
More information about the Blotter-commits
mailing list