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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 14 17:03:38 CET 2011


Author: gsee
Date: 2011-12-14 17:03:38 +0100 (Wed, 14 Dec 2011)
New Revision: 877

Modified:
   pkg/FinancialInstrument/R/instrument.R
   pkg/FinancialInstrument/man/currencies.Rd
   pkg/FinancialInstrument/man/instrument.auto.Rd
   pkg/FinancialInstrument/man/make_spread_id.Rd
   pkg/FinancialInstrument/man/root_contracts.Rd
Log:
 - add root arg to instrument.auto that will passed to parse_id
 - roxygen2 made some changes to keywords.


Modified: pkg/FinancialInstrument/R/instrument.R
===================================================================
--- pkg/FinancialInstrument/R/instrument.R	2011-12-11 22:51:01 UTC (rev 876)
+++ pkg/FinancialInstrument/R/instrument.R	2011-12-14 16:03:38 UTC (rev 877)
@@ -697,6 +697,7 @@
 #' @param multiplier numeric product multiplier
 #' @param silent TRUE/FALSE. silence warnings?
 #' @param default_type What type of instrument to make if it is not clear from the primary_id. ("stock", "future", etc.) Default is NULL.
+#' @param root character string to pass to \code{\link{parse_id}} to be used as the root_id for easier/more accurate parsing.
 #' @param assign_i TRUE/FALSE. Should the \code{instrument} be assigned in the \code{.instrument} environment?
 #' @param ... other passthrough parameters
 #' @return Primarily called for its side-effect, but will return the name of the instrument that was created
@@ -722,7 +723,7 @@
 #' getInstrument("VX_H11") #made a future_series
 #' }
 #' @export
-instrument.auto <- function(primary_id, currency='USD', multiplier=1, silent=FALSE, default_type='NULL', assign_i=TRUE, ...) {
+instrument.auto <- function(primary_id, currency='USD', multiplier=1, silent=FALSE, default_type='NULL', root=NULL, assign_i=TRUE, ...) {
 ##TODO: check formals against dots and remove duplicates from dots before calling constructors to avoid
 # 'formal argument "multiplier" matched by multiple actual arguments'
     if (!is.currency(currency)) {
@@ -734,7 +735,7 @@
     }
     warned <- FALSE
     dargs <- list(...)    
-    pid <- parse_id(primary_id)
+    pid <- parse_id(primary_id, root=root)
     type <- NULL
     if (any(pid$type == 'calendar')) {
         return(guaranteed_spread(primary_id, currency=currency, defined.by='auto', assign_i=assign_i, ...))

Modified: pkg/FinancialInstrument/man/currencies.Rd
===================================================================
--- pkg/FinancialInstrument/man/currencies.Rd	2011-12-11 22:51:01 UTC (rev 876)
+++ pkg/FinancialInstrument/man/currencies.Rd	2011-12-14 16:03:38 UTC (rev 877)
@@ -7,5 +7,5 @@
   \code{\link{load.instruments}}
 }
 \keyword{data}
-\keyword{datasets}
+\keyword{dataset}
 

Modified: pkg/FinancialInstrument/man/instrument.auto.Rd
===================================================================
--- pkg/FinancialInstrument/man/instrument.auto.Rd	2011-12-11 22:51:01 UTC (rev 876)
+++ pkg/FinancialInstrument/man/instrument.auto.Rd	2011-12-14 16:03:38 UTC (rev 877)
@@ -4,7 +4,7 @@
 \usage{
   instrument.auto(primary_id, currency = "USD",
     multiplier = 1, silent = FALSE, default_type = "NULL",
-    assign_i = TRUE, ...)
+    root = NULL, assign_i = TRUE, ...)
 }
 \arguments{
   \item{primary_id}{charater primary identifier of
@@ -21,6 +21,10 @@
   is not clear from the primary_id. ("stock", "future",
   etc.) Default is NULL.}
 
+  \item{root}{character string to pass to
+  \code{\link{parse_id}} to be used as the root_id for
+  easier/more accurate parsing.}
+
   \item{assign_i}{TRUE/FALSE. Should the \code{instrument}
   be assigned in the \code{.instrument} environment?}
 

Modified: pkg/FinancialInstrument/man/make_spread_id.Rd
===================================================================
--- pkg/FinancialInstrument/man/make_spread_id.Rd	2011-12-11 22:51:01 UTC (rev 876)
+++ pkg/FinancialInstrument/man/make_spread_id.Rd	2011-12-14 16:03:38 UTC (rev 877)
@@ -2,7 +2,7 @@
 \alias{make_spread_id}
 \title{construct a primary_id for a spread instrument from the primary_ids of its members}
 \usage{
-  make_spread_id(x, root = NULL, format = NULL)
+  make_spread_id(x, root = NULL, format = NULL, sep = "_")
 }
 \arguments{
   \item{x}{vector of member primary_ids}
@@ -14,6 +14,9 @@
   or \code{FALSE}, no formatting will be done.  the See
   \code{\link{format_id}} for other accepted values for
   \code{format}}
+
+  \item{sep}{character string to separate root_id and
+  suffix_id}
 }
 \value{
   character string that can be used as a primary_id for a

Modified: pkg/FinancialInstrument/man/root_contracts.Rd
===================================================================
--- pkg/FinancialInstrument/man/root_contracts.Rd	2011-12-11 22:51:01 UTC (rev 876)
+++ pkg/FinancialInstrument/man/root_contracts.Rd	2011-12-14 16:03:38 UTC (rev 877)
@@ -7,5 +7,5 @@
   \code{\link{load.instruments}}
 }
 \keyword{data}
-\keyword{datasets}
+\keyword{dataset}
 



More information about the Blotter-commits mailing list