[Blotter-commits] r119 - pkg/blotter/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Nov 14 00:53:33 CET 2009


Author: jryan
Date: 2009-11-14 00:53:33 +0100 (Sat, 14 Nov 2009)
New Revision: 119

Modified:
   pkg/blotter/R/initPortf.R
Log:
o   changed grep to match in initPortf to account for multiple hits


Modified: pkg/blotter/R/initPortf.R
===================================================================
--- pkg/blotter/R/initPortf.R	2009-11-13 23:39:31 UTC (rev 118)
+++ pkg/blotter/R/initPortf.R	2009-11-13 23:53:33 UTC (rev 119)
@@ -28,7 +28,7 @@
     if(length(initPosQty)!=length(symbols))
 	stop("The length of initPosQty is unequal to the number of symbols in the portfolio.")
     for(instrument in symbols){
-    	i = grep(instrument, symbols)
+    	i = match(instrument, symbols)
         portfolio[[instrument]]$txn = initTxn(initDate = initDate, initPosQty = initPosQty[i])
         portfolio[[instrument]]$posPL = initPosPL(initDate = initDate, initPosQty = initPosQty[i])
     }



More information about the Blotter-commits mailing list