[Blotter-commits] r969 - pkg/FinancialInstrument/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Mar 8 15:20:57 CET 2012


Author: gsee
Date: 2012-03-08 15:20:57 +0100 (Thu, 08 Mar 2012)
New Revision: 969

Modified:
   pkg/FinancialInstrument/R/find.instrument.R
Log:
 only return unique ids found with find.instrument

Modified: pkg/FinancialInstrument/R/find.instrument.R
===================================================================
--- pkg/FinancialInstrument/R/find.instrument.R	2012-03-08 03:28:31 UTC (rev 968)
+++ pkg/FinancialInstrument/R/find.instrument.R	2012-03-08 14:20:57 UTC (rev 969)
@@ -62,6 +62,6 @@
     tbl <- if (where == "anywhere") {
         instrument.table(Symbols, exclude=exclude)
     } else buildHierarchy(Symbols, where[!where %in% exclude])
-    tbl[unique(unname(unlist(apply(tbl, 2, function(x) 
-        grep(pattern=text, x=x, ignore.case=ignore.case, ...))))), 1]
+    unique(tbl[unique(unname(unlist(apply(tbl, 2, function(x) 
+        grep(pattern=text, x=x, ignore.case=ignore.case, ...))))), 1])
 }



More information about the Blotter-commits mailing list