[Blotter-commits] r857 - in pkg/FinancialInstrument: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Dec 3 21:39:18 CET 2011


Author: gsee
Date: 2011-12-03 21:39:17 +0100 (Sat, 03 Dec 2011)
New Revision: 857

Modified:
   pkg/FinancialInstrument/DESCRIPTION
   pkg/FinancialInstrument/R/parse_id.R
Log:
use sub instead of gsub to remove only first occurrence of root from primary_id string

Modified: pkg/FinancialInstrument/DESCRIPTION
===================================================================
--- pkg/FinancialInstrument/DESCRIPTION	2011-12-01 14:22:17 UTC (rev 856)
+++ pkg/FinancialInstrument/DESCRIPTION	2011-12-03 20:39:17 UTC (rev 857)
@@ -11,7 +11,7 @@
     meta-data and relationships. Provides support for
     multi-asset class and multi-currency portfolios. Still
     in heavy development.
-Version: 0.9.2
+Version: 0.9.3
 URL: https://r-forge.r-project.org/projects/blotter/
 Date: $Date$
 Depends:

Modified: pkg/FinancialInstrument/R/parse_id.R
===================================================================
--- pkg/FinancialInstrument/R/parse_id.R	2011-12-01 14:22:17 UTC (rev 856)
+++ pkg/FinancialInstrument/R/parse_id.R	2011-12-03 20:39:17 UTC (rev 857)
@@ -28,7 +28,7 @@
     sufftype <- TRUE #will we use the type given by parse_suffix, or overwrite it with e.g. 'exchange_rate', or 'synthetic'
     suffformat <- TRUE #If x begins with "^" this will be set to FALSE, and we'll overwrite parse_suffix(...)$format with yahooIndex" 
     if (!is.null(root)) {
-        suffix <- gsub(root,"",x) #turns ESU1 into U1, or ES_U11 into _U11 
+        suffix <- sub(root,"",x) #turns ESU1 into U1, or ES_U11 into _U11 
         suffix <- gsub("_","",suffix) #take out the underscore if there is one
     } else if (identical(integer(0), grep("[0-9]",x))) { 
         #if there are no numbers in the id, then it has no year, so it is not a recognized future or option



More information about the Blotter-commits mailing list