[Blotter-commits] r565 - pkg/blotter/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Mar 2 20:54:56 CET 2011
Author: braverock
Date: 2011-03-02 20:54:55 +0100 (Wed, 02 Mar 2011)
New Revision: 565
Modified:
pkg/blotter/R/getPos.R
Log:
- fix subsetting bug reported by 'Immanuel' on R-SIG-Finance, thanks to Jeff and Josh for helping track it down
Modified: pkg/blotter/R/getPos.R
===================================================================
--- pkg/blotter/R/getPos.R 2011-03-02 14:11:37 UTC (rev 564)
+++ pkg/blotter/R/getPos.R 2011-03-02 19:54:55 UTC (rev 565)
@@ -18,12 +18,12 @@
# position average cost are returned.
#if(nrow(PosData)>1) Pos = last(PosData[toDate][,Columns],n=n)
if(nrow(PosData)>1) {
- if(is.timeBased(Date)){
- Pos = last(PosData[index(PosData)<Date][,Columns],n=n)
- } else {
+# if(is.timeBased(Date)){
+# Pos = last(PosData[index(PosData)<Date][,Columns],n=n)
+# } else {
toDate = paste('::', Date, sep="")
Pos = last(PosData[toDate][,Columns],n=n)
- }
+# }
} else Pos <- PosData[,Columns]
return(Pos)
}
More information about the Blotter-commits
mailing list