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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Dec 8 17:27:18 CET 2011


Author: gsee
Date: 2011-12-08 17:27:18 +0100 (Thu, 08 Dec 2011)
New Revision: 866

Modified:
   pkg/FinancialInstrument/R/load.instruments.R
   pkg/FinancialInstrument/man/currencies.Rd
   pkg/FinancialInstrument/man/root_contracts.Rd
   pkg/FinancialInstrument/man/setSymbolLookup.FI.Rd
Log:
 - add Symbols arg to setSymbolLookup.FI so that it can be used on only some instruments.
 - roxygen2 added some keywords to some Rd files


Modified: pkg/FinancialInstrument/R/load.instruments.R
===================================================================
--- pkg/FinancialInstrument/R/load.instruments.R	2011-12-08 15:18:47 UTC (rev 865)
+++ pkg/FinancialInstrument/R/load.instruments.R	2011-12-08 16:27:18 UTC (rev 866)
@@ -148,6 +148,7 @@
 #' the data by days, which is why that option is the default.
 #'     
 #' @param base_dir string specifying the base directory where data is stored, see Details 
+#' @param Symbols character vector of names of instruments for which to \code{setSymbolLookup}
 #' @param \dots any other passthru parameters
 #' @param storage_method currently only \sQuote{rda}, but we will eventually support \sQuote{indexing} at least, and maybe others
 #' @param split_method string specifying the method files are split, currently \sQuote{days} or \sQuote{common}, see Details
@@ -160,15 +161,17 @@
 #' \code{\link[quantmod]{setSymbolLookup}}
 #' @importFrom zoo as.Date
 #' @export
-setSymbolLookup.FI<-function(base_dir,..., split_method=c("days","common"), storage_method='rda', use_identifier='primary_id', extension='rda', src='FI'){
+setSymbolLookup.FI<-function(base_dir, Symbols, ..., split_method=c("days","common"), storage_method='rda', use_identifier='primary_id', extension='rda', src='FI'){
     # check that base_dir exists
     if(!file.exists(base_dir)) stop('base_dir ',base_dir,' does not seem to specify a valid path' )
     
     # take split
     split_method<-split_method[1] # only use the first value
-    
+
     #load all instrument names
-    instr_names<-ls(pos=.instrument)
+    instr_names <- if(missing(Symbols)) {
+        ls_non_currencies(ls(pos=.instrument)) #if roots begin with a dot, this will filter out roots and currencies
+    } else Symbols
     
     #TODO add check to make sure that src is actually the name of a getSymbols function
     

Modified: pkg/FinancialInstrument/man/currencies.Rd
===================================================================
--- pkg/FinancialInstrument/man/currencies.Rd	2011-12-08 15:18:47 UTC (rev 865)
+++ pkg/FinancialInstrument/man/currencies.Rd	2011-12-08 16:27:18 UTC (rev 866)
@@ -7,5 +7,5 @@
   \code{\link{load.instruments}}
 }
 \keyword{data}
-\keyword{datasets}
+\keyword{dataset}
 

Modified: pkg/FinancialInstrument/man/root_contracts.Rd
===================================================================
--- pkg/FinancialInstrument/man/root_contracts.Rd	2011-12-08 15:18:47 UTC (rev 865)
+++ pkg/FinancialInstrument/man/root_contracts.Rd	2011-12-08 16:27:18 UTC (rev 866)
@@ -7,5 +7,5 @@
   \code{\link{load.instruments}}
 }
 \keyword{data}
-\keyword{datasets}
+\keyword{dataset}
 

Modified: pkg/FinancialInstrument/man/setSymbolLookup.FI.Rd
===================================================================
--- pkg/FinancialInstrument/man/setSymbolLookup.FI.Rd	2011-12-08 15:18:47 UTC (rev 865)
+++ pkg/FinancialInstrument/man/setSymbolLookup.FI.Rd	2011-12-08 16:27:18 UTC (rev 866)
@@ -2,7 +2,7 @@
 \alias{setSymbolLookup.FI}
 \title{set quantmod-style SymbolLookup for instruments}
 \usage{
-  setSymbolLookup.FI(base_dir, ...,
+  setSymbolLookup.FI(base_dir, Symbols, ...,
     split_method = c("days", "common"),
     storage_method = "rda", use_identifier = "primary_id",
     extension = "rda", src = "FI")
@@ -11,6 +11,9 @@
   \item{base_dir}{string specifying the base directory
   where data is stored, see Details}
 
+  \item{Symbols}{character vector of names of instruments
+  for which to \code{setSymbolLookup}}
+
   \item{\dots}{any other passthru parameters}
 
   \item{storage_method}{currently only \sQuote{rda}, but we



More information about the Blotter-commits mailing list