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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 4 01:50:43 CEST 2012


Author: gsee
Date: 2012-06-04 01:50:43 +0200 (Mon, 04 Jun 2012)
New Revision: 1039

Modified:
   pkg/FinancialInstrument/DESCRIPTION
   pkg/FinancialInstrument/NAMESPACE
   pkg/FinancialInstrument/R/saveInstruments.R
   pkg/FinancialInstrument/man/saveInstruments.Rd
Log:
 add reloadInstruments wrapper for loadInstruments that removes all instruments before calling loadInstruments

Modified: pkg/FinancialInstrument/DESCRIPTION
===================================================================
--- pkg/FinancialInstrument/DESCRIPTION	2012-06-03 15:36:21 UTC (rev 1038)
+++ pkg/FinancialInstrument/DESCRIPTION	2012-06-03 23:50:43 UTC (rev 1039)
@@ -11,7 +11,7 @@
     meta-data and relationships. Provides support for
     multi-asset class and multi-currency portfolios. Still
     in heavy development.
-Version: 0.14.5
+Version: 0.14.6
 URL: https://r-forge.r-project.org/projects/blotter/
 Date: $Date$
 Depends:

Modified: pkg/FinancialInstrument/NAMESPACE
===================================================================
--- pkg/FinancialInstrument/NAMESPACE	2012-06-03 15:36:21 UTC (rev 1038)
+++ pkg/FinancialInstrument/NAMESPACE	2012-06-03 23:50:43 UTC (rev 1039)
@@ -86,6 +86,7 @@
 export(parse_suffix)
 export(prev.future_id)
 export(redenominate)
+export(reloadInstruments)
 export(rm_bonds)
 export(rm_by_currency)
 export(rm_by_expiry)

Modified: pkg/FinancialInstrument/R/saveInstruments.R
===================================================================
--- pkg/FinancialInstrument/R/saveInstruments.R	2012-06-03 15:36:21 UTC (rev 1038)
+++ pkg/FinancialInstrument/R/saveInstruments.R	2012-06-03 23:50:43 UTC (rev 1039)
@@ -21,7 +21,9 @@
 #' to save the entire .instrument environment to disk.
 #'
 #' \code{loadInstruments} will read a file that contains instruments and add 
-#' those instrument definitions to your .instrument environment
+#' those instrument definitions to your .instrument environment.  
+#' \code{reloadInstruments} will remove all instruments in the current 
+#' .instrument environment before loading instruments from disk.
 #' 
 #' The \code{file_name} should have a file extension of \dQuote{RData}, 
 #' \dQuote{rda}, \dQuote{R}, or \dQuote{txt}.  If the \code{file_name} does not
@@ -121,3 +123,9 @@
 }
 
 
+#' @export
+#' @rdname saveInstruments
+reloadInstruments <- function(file_name="MyInstruments", dir="") {
+    rm_instruments(keep.currencies=FALSE)
+    loadInstruments(file_name=file_name, dir=dir)
+}

Modified: pkg/FinancialInstrument/man/saveInstruments.Rd
===================================================================
--- pkg/FinancialInstrument/man/saveInstruments.Rd	2012-06-03 15:36:21 UTC (rev 1038)
+++ pkg/FinancialInstrument/man/saveInstruments.Rd	2012-06-03 23:50:43 UTC (rev 1039)
@@ -1,11 +1,14 @@
 \name{saveInstruments}
 \alias{loadInstruments}
+\alias{reloadInstruments}
 \alias{saveInstruments}
 \title{Save and Load all instrument definitions}
 \usage{
   saveInstruments(file_name = "MyInstruments", dir = "")
 
   loadInstruments(file_name = "MyInstruments", dir = "")
+
+  reloadInstruments(file_name = "MyInstruments", dir = "")
 }
 \arguments{
   \item{file_name}{name of file. e.g.
@@ -29,7 +32,9 @@
 
   \code{loadInstruments} will read a file that contains
   instruments and add those instrument definitions to your
-  .instrument environment
+  .instrument environment. \code{reloadInstruments} will
+  remove all instruments in the current .instrument
+  environment before loading instruments from disk.
 
   The \code{file_name} should have a file extension of
   \dQuote{RData}, \dQuote{rda}, \dQuote{R}, or



More information about the Blotter-commits mailing list