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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 12 22:12:52 CET 2013


Author: gsee
Date: 2013-02-12 22:12:51 +0100 (Tue, 12 Feb 2013)
New Revision: 1396

Modified:
   pkg/FinancialInstrument/DESCRIPTION
   pkg/FinancialInstrument/NEWS
   pkg/FinancialInstrument/R/saveInstruments.R
   pkg/FinancialInstrument/man/saveInstruments.Rd
Log:
 saveInstruments gains a "compress" argument

Modified: pkg/FinancialInstrument/DESCRIPTION
===================================================================
--- pkg/FinancialInstrument/DESCRIPTION	2013-02-12 19:21:18 UTC (rev 1395)
+++ pkg/FinancialInstrument/DESCRIPTION	2013-02-12 21:12:51 UTC (rev 1396)
@@ -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.5
+Version: 1.1.6
 URL: https://r-forge.r-project.org/projects/blotter/
-Date: 2013-02-10
+Date: 2013-02-12
 Depends:
     R (>= 2.12.0),
     quantmod(>= 0.3-17),

Modified: pkg/FinancialInstrument/NEWS
===================================================================
--- pkg/FinancialInstrument/NEWS	2013-02-12 19:21:18 UTC (rev 1395)
+++ pkg/FinancialInstrument/NEWS	2013-02-12 21:12:51 UTC (rev 1396)
@@ -1,5 +1,9 @@
 Changes in Version 1.2
 ======================
+USER VISIBLE CHANGES
+--------------------
+* saveInstruments() gains a "compress" argument to allow for different 
+  compression than the default ("gzip")
 
 BUG FIXES
 ---------

Modified: pkg/FinancialInstrument/R/saveInstruments.R
===================================================================
--- pkg/FinancialInstrument/R/saveInstruments.R	2013-02-12 19:21:18 UTC (rev 1395)
+++ pkg/FinancialInstrument/R/saveInstruments.R	2013-02-12 21:12:51 UTC (rev 1396)
@@ -39,6 +39,7 @@
 #' As an experimental feature, a \code{list} or \code{environment} can be passed 
 #' to \code{file_name}.
 #' @param dir Directory of file (defaults to current working directory. ie. "")
+#' @param compress argument passed to \code{\link{save}}, default is "gzip"
 #' @return Called for side-effect
 #' @author Garrett See
 #' @seealso save, load load.instrument define_stocks, define_futures,
@@ -59,7 +60,7 @@
 #' }
 #' @export 
 #' @rdname saveInstruments
-saveInstruments <- function(file_name="MyInstruments", dir="") {
+saveInstruments <- function(file_name="MyInstruments", dir="", compress="gzip") {
 	if (!is.null(dir) && !dir == "" && substr(dir,nchar(dir),nchar(dir)) != "/")
 		dir <- paste(dir,"/",sep="")
     .instrument <- FinancialInstrument:::.instrument
@@ -82,7 +83,7 @@
             sink()
             #system(paste("cat", file.name)) #for debugging    
         }
-    } else save(.instrument, file = file.name, compress='bzip2')	
+    } else save(.instrument, file = file.name, compress=compress)	
 }
 
 

Modified: pkg/FinancialInstrument/man/saveInstruments.Rd
===================================================================
--- pkg/FinancialInstrument/man/saveInstruments.Rd	2013-02-12 19:21:18 UTC (rev 1395)
+++ pkg/FinancialInstrument/man/saveInstruments.Rd	2013-02-12 21:12:51 UTC (rev 1396)
@@ -4,7 +4,8 @@
 \alias{saveInstruments}
 \title{Save and Load all instrument definitions}
 \usage{
-  saveInstruments(file_name = "MyInstruments", dir = "")
+  saveInstruments(file_name = "MyInstruments", dir = "",
+    compress = "gzip")
 
   loadInstruments(file_name = "MyInstruments", dir = "")
 
@@ -18,6 +19,9 @@
 
   \item{dir}{Directory of file (defaults to current working
   directory. ie. "")}
+
+  \item{compress}{argument passed to \code{\link{save}},
+  default is "gzip"}
 }
 \value{
   Called for side-effect



More information about the Blotter-commits mailing list