[Blotter-commits] r51 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jan 21 16:10:18 CET 2009


Author: peter_carl
Date: 2009-01-21 16:10:18 +0100 (Wed, 21 Jan 2009)
New Revision: 51

Modified:
   pkg/R/getBySymbol.R
Log:
- added Symbol attribute for scoping by instrument


Modified: pkg/R/getBySymbol.R
===================================================================
--- pkg/R/getBySymbol.R	2009-01-13 04:59:15 UTC (rev 50)
+++ pkg/R/getBySymbol.R	2009-01-21 15:10:18 UTC (rev 51)
@@ -1,5 +1,5 @@
 `getBySymbol` <-
-function(Portfolio, Attribute, Symbols = NULL, Date=NULL)
+function(Portfolio, Attribute, Date=NULL, Symbols = NULL)
 { # @author Peter Carl
 
     # DESCRIPTION:
@@ -27,8 +27,10 @@
         symbols=names(Portfolio)
     else
         symbols = Symbols
-    for (i in 1:length(symbols)) 
+    for (i in 1:length(symbols)) {
         table = merge(table, Portfolio[[i]]$posPL[Date,Attribute,drop=FALSE])
+        #table = cbind(table, Portfolio[[i]]$posPL[Date,Attribute,drop=FALSE])
+    }
     colnames(table) = symbols
     return(table)
 



More information about the Blotter-commits mailing list