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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 9 15:28:07 CET 2012


Author: gsee
Date: 2012-03-09 15:28:06 +0100 (Fri, 09 Mar 2012)
New Revision: 971

Modified:
   pkg/FinancialInstrument/R/find.instrument.R
Log:
 -avoid warning if "where" is a vector


Modified: pkg/FinancialInstrument/R/find.instrument.R
===================================================================
--- pkg/FinancialInstrument/R/find.instrument.R	2012-03-09 14:23:03 UTC (rev 970)
+++ pkg/FinancialInstrument/R/find.instrument.R	2012-03-09 14:28:06 UTC (rev 971)
@@ -59,7 +59,7 @@
 #' @export
 find.instrument <- function(text, where='anywhere', Symbols = ls_instruments(),
                             ignore.case=TRUE, exclude=NULL, ...) {
-    tbl <- if (where == "anywhere") {
+    tbl <- if (length(where) == 1 && where == "anywhere") {
         instrument.table(Symbols, exclude=exclude)
     } else buildHierarchy(Symbols, where[!where %in% exclude])
     unique(tbl[unique(unname(unlist(apply(tbl, 2, function(x) 



More information about the Blotter-commits mailing list