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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Mar 24 05:19:17 CET 2012


Author: gsee
Date: 2012-03-24 05:19:17 +0100 (Sat, 24 Mar 2012)
New Revision: 980

Modified:
   pkg/FinancialInstrument/DESCRIPTION
   pkg/FinancialInstrument/R/instrument.R
   pkg/FinancialInstrument/man/add.identifier.Rd
Log:
 patch add.identifier so that identifiers can be named arguments or a list.

Modified: pkg/FinancialInstrument/DESCRIPTION
===================================================================
--- pkg/FinancialInstrument/DESCRIPTION	2012-03-24 03:23:46 UTC (rev 979)
+++ pkg/FinancialInstrument/DESCRIPTION	2012-03-24 04:19:17 UTC (rev 980)
@@ -11,7 +11,7 @@
     meta-data and relationships. Provides support for
     multi-asset class and multi-currency portfolios. Still
     in heavy development.
-Version: 0.13.3
+Version: 0.13.4
 URL: https://r-forge.r-project.org/projects/blotter/
 Date: $Date$
 Depends:

Modified: pkg/FinancialInstrument/R/instrument.R
===================================================================
--- pkg/FinancialInstrument/R/instrument.R	2012-03-24 03:23:46 UTC (rev 979)
+++ pkg/FinancialInstrument/R/instrument.R	2012-03-24 04:19:17 UTC (rev 980)
@@ -1096,16 +1096,14 @@
 #' @examples
 #' \dontrun{
 #' stock("XXX", currency("USD"))
-#' add.identifier("XXX", list(yahoo="^XXX")) 
+#' add.identifier("XXX", yahoo="^XXX") 
 #' getInstrument("^XXX")
 #' add.identifier("^XXX", "x3")
 #' all.equal(getInstrument("x3"), getInstrument("XXX")) #TRUE
 #' }
 #' @export
 add.identifier <- function(primary_id, ...) {
-    udots <- unlist(...)
-    new.ids <- list(udots)
-    names(new.ids) <- names(udots)
+    new.ids <- as.list(unlist(list(...)))
     instr <- getInstrument(primary_id)
     if (!inherits(instr, "instrument")) {
         stop(paste(primary_id, "is not a defined instrument"))

Modified: pkg/FinancialInstrument/man/add.identifier.Rd
===================================================================
--- pkg/FinancialInstrument/man/add.identifier.Rd	2012-03-24 03:23:46 UTC (rev 979)
+++ pkg/FinancialInstrument/man/add.identifier.Rd	2012-03-24 04:19:17 UTC (rev 980)
@@ -21,7 +21,7 @@
 \examples{
 \dontrun{
 stock("XXX", currency("USD"))
-add.identifier("XXX", list(yahoo="^XXX"))
+add.identifier("XXX", yahoo="^XXX")
 getInstrument("^XXX")
 add.identifier("^XXX", "x3")
 all.equal(getInstrument("x3"), getInstrument("XXX")) #TRUE



More information about the Blotter-commits mailing list