[Blotter-commits] r977 - pkg/FinancialInstrument/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Mar 24 01:10:48 CET 2012
Author: gsee
Date: 2012-03-24 01:10:48 +0100 (Sat, 24 Mar 2012)
New Revision: 977
Modified:
pkg/FinancialInstrument/R/instrument.R
Log:
getInstrument searches for x in addition to make.names(x)
Modified: pkg/FinancialInstrument/R/instrument.R
===================================================================
--- pkg/FinancialInstrument/R/instrument.R 2012-03-19 15:12:50 UTC (rev 976)
+++ pkg/FinancialInstrument/R/instrument.R 2012-03-24 00:10:48 UTC (rev 977)
@@ -961,8 +961,9 @@
ul.instr <- unlist(as.list(FinancialInstrument:::.instrument, all.names=TRUE))
# subset by names that include "identifiers"
ul.ident <- ul.instr[grep('identifiers', names(ul.instr))]
- # if x is in the identifiers subset, extract the primary_id from the name
- tmpname <- ul.ident[match(xx, ul.ident, 0)]
+ # if x (or make.names(x)) is in the identifiers subset, extract the
+ # primary_id from the name
+ tmpname <- ul.ident[ul.ident %in% unique(c(x, xx))]
# if x was not in ul.ident, tmpname will == named character(0)
if (length(tmpname) > 0) {
#primary_id is everything before .identifiers
More information about the Blotter-commits
mailing list