[Rcpp-commits] r2870 - in pkg/RcppBDT: . demo

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 14 04:00:52 CET 2011


Author: edd
Date: 2011-01-14 04:00:50 +0100 (Fri, 14 Jan 2011)
New Revision: 2870

Modified:
   pkg/RcppBDT/ChangeLog
   pkg/RcppBDT/demo/RcppBDT.R
Log:
demo() becomes simpler as we have a format() method


Modified: pkg/RcppBDT/ChangeLog
===================================================================
--- pkg/RcppBDT/ChangeLog	2011-01-13 22:26:51 UTC (rev 2869)
+++ pkg/RcppBDT/ChangeLog	2011-01-14 03:00:50 UTC (rev 2870)
@@ -2,6 +2,7 @@
 
 	* R/zzz.R: added print and format methods
 	* man/bdt.Rd: documented print and format methods
+	* demo/RcppBDT.R: simplied thanks to format method
 
 2011-01-12  Dirk Eddelbuettel  <edd at debian.org>
 

Modified: pkg/RcppBDT/demo/RcppBDT.R
===================================================================
--- pkg/RcppBDT/demo/RcppBDT.R	2011-01-13 22:26:51 UTC (rev 2869)
+++ pkg/RcppBDT/demo/RcppBDT.R	2011-01-14 03:00:50 UTC (rev 2870)
@@ -15,17 +15,17 @@
 
     cat("Demo of setters\n");
     ## conversions from string commented out, see inst/include/RcppBDT.h for details
-    ##bdt$fromString("2010-10-02"); 	cat("From 2010-10-02   : ", format(bdt$getDate()), "\n")
-    ##bdt$fromUndelString("20101003");  cat("From 20101003     : ", format(bdt$getDate()), "\n")
-    bdt$setFromUTC(); 			cat("From curr. UTC    : ", format(bdt$getDate()), "\n")
-    bdt$setFromLocalClock();		cat("From curr. local  : ", format(bdt$getDate()), "\n")
-    bdt$setEndOfMonth(); 		cat("end of month      : ", format(bdt$getDate()), "\n")
-    bdt$setFirstOfNextMonth(); 		cat("1st of next Month : ", format(bdt$getDate()), "\n")
-    bdt$addDays(4);                     cat("plus four days    : ", format(bdt$getDate()), "\n")
-    bdt$subtractDays(3);                cat("minus three days  : ", format(bdt$getDate()), "\n")
+    ##bdt$fromString("2010-10-02"); 	cat("From 2010-10-02   : ", format(bdt), "\n")
+    ##bdt$fromUndelString("20101003");  cat("From 20101003     : ", format(bdt), "\n")
+    bdt$setFromUTC(); 			cat("From curr. UTC    : ", format(bdt), "\n")
+    bdt$setFromLocalClock();		cat("From curr. local  : ", format(bdt), "\n")
+    bdt$setEndOfMonth(); 		cat("end of month      : ", format(bdt), "\n")
+    bdt$setFirstOfNextMonth(); 		cat("1st of next Month : ", format(bdt), "\n")
+    bdt$addDays(4);                     cat("plus four days    : ", format(bdt), "\n")
+    bdt$subtractDays(3);                cat("minus three days  : ", format(bdt), "\n")
 
-    bdt$setIMMDate(12, 2010); 		cat("IMM Date Dec 2010 : ", format(bdt$getDate()), "\n")
-    bdt$setEndOfBizWeek();  		cat("end of biz week   : ", format(bdt$getDate()), "\n")
+    bdt$setIMMDate(12, 2010); 		cat("IMM Date Dec 2010 : ", format(bdt), "\n")
+    bdt$setEndOfBizWeek();  		cat("end of biz week   : ", format(bdt), "\n")
 
     cat("\nDemo of getters\n")
     ## now just functions that return values to R



More information about the Rcpp-commits mailing list