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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Mar 3 17:14:56 CET 2013


Author: gsee
Date: 2013-03-03 17:14:56 +0100 (Sun, 03 Mar 2013)
New Revision: 1406

Modified:
   pkg/FinancialInstrument/DESCRIPTION
   pkg/FinancialInstrument/NEWS
   pkg/FinancialInstrument/R/format_id.R
Log:
 sort_ids() is less locale-specific; see NEWS.  Thanks to Alexis Petit for the patch

Modified: pkg/FinancialInstrument/DESCRIPTION
===================================================================
--- pkg/FinancialInstrument/DESCRIPTION	2013-02-26 15:07:51 UTC (rev 1405)
+++ pkg/FinancialInstrument/DESCRIPTION	2013-03-03 16:14:56 UTC (rev 1406)
@@ -9,9 +9,9 @@
 Contributors: Dirk Eddelbuettel, Alexis Petit, Jeffrey Ryan, Joshua Ulrich
 Description: Infrastructure for defining meta-data and
     relationships for financial instruments.
-Version: 1.1.6
+Version: 1.1.7
 URL: https://r-forge.r-project.org/projects/blotter/
-Date: 2013-02-12
+Date: 2013-03-03
 Depends:
     R (>= 2.12.0),
     quantmod(>= 0.3-17),

Modified: pkg/FinancialInstrument/NEWS
===================================================================
--- pkg/FinancialInstrument/NEWS	2013-02-26 15:07:51 UTC (rev 1405)
+++ pkg/FinancialInstrument/NEWS	2013-03-03 16:14:56 UTC (rev 1406)
@@ -19,6 +19,11 @@
   instrument object would be used even if the user passed a different currency
   in the old_base argument.  
 
+* sort_ids() only worked in some locales when an instrument is not defined.  It 
+  now converts the month (returned by parse_id()) to numeric (with MC2N()) and 
+  uses the "%m" format in the as.Date call instead of using the month name with 
+  the (locale-specific) "%b" format.  Thanks to Alexis Petit for the patch.
+
 TESTS
 -----
 

Modified: pkg/FinancialInstrument/R/format_id.R
===================================================================
--- pkg/FinancialInstrument/R/format_id.R	2013-02-26 15:07:51 UTC (rev 1405)
+++ pkg/FinancialInstrument/R/format_id.R	2013-03-03 16:14:56 UTC (rev 1406)
@@ -283,7 +283,7 @@
             }
         }
         pid <- parse_id(x, ...)
-        as.Date(paste(pid$year, pid$month, 1, sep=''), format="%Y%b%d")
+        as.Date(paste(pid$year, MC2N(pid$month), 1, sep = "-"), format = "%Y-%m-%d")
     }
     out1 <- names(sort(sapply(ids,f, ...)))
     out2 <- sort(ids[!(ids %in% out1)])



More information about the Blotter-commits mailing list