[Rquantlib-commits] r326 - in pkg/RQuantLib: . R src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Dec 2 18:10:25 CET 2012


Author: edd
Date: 2012-12-02 18:10:25 +0100 (Sun, 02 Dec 2012)
New Revision: 326

Modified:
   pkg/RQuantLib/ChangeLog
   pkg/RQuantLib/R/discount.R
   pkg/RQuantLib/src/discount.cpp
Log:
farting around with Rcpp::DataFrame::create to avoid one (spurious?) build error on Windows


Modified: pkg/RQuantLib/ChangeLog
===================================================================
--- pkg/RQuantLib/ChangeLog	2012-12-01 19:45:22 UTC (rev 325)
+++ pkg/RQuantLib/ChangeLog	2012-12-02 17:10:25 UTC (rev 326)
@@ -1,3 +1,9 @@
+2012-12-02  Dirk Eddelbuettel  <edd at debian.org>
+
+	* src/discount.cpp (DiscountCurve): R-devel on Windows now longer
+	likes a data.frame instantiation here, so passing back as list and ...
+	* R/discount.R (DiscountCurve.default): ... making it a data.frame here.
+
 2012-12-01  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Release 0.3.9

Modified: pkg/RQuantLib/R/discount.R
===================================================================
--- pkg/RQuantLib/R/discount.R	2012-12-01 19:45:22 UTC (rev 325)
+++ pkg/RQuantLib/R/discount.R	2012-12-02 17:10:25 UTC (rev 326)
@@ -45,6 +45,7 @@
 
     ## Finally ready to make the call...
     val <- .Call("DiscountCurve", params, tsQuotes, times, PACKAGE="RQuantLib")
+    val[["table"]] <- as.data.frame(val[["table"]])  ## Windows all of a sudden needs this
     class(val) <- c("DiscountCurve")
     val
 }

Modified: pkg/RQuantLib/src/discount.cpp
===================================================================
--- pkg/RQuantLib/src/discount.cpp	2012-12-01 19:45:22 UTC (rev 325)
+++ pkg/RQuantLib/src/discount.cpp	2012-12-02 17:10:25 UTC (rev 326)
@@ -127,8 +127,10 @@
             zeroRates[i] = curve->zeroRate(current, QuantLib::ActualActual(), QuantLib::Continuous);
             d++;
         }
-        Rcpp::DataFrame frame = Rcpp::DataFrame::create(Rcpp::Named("date") = dates,
-                                                        Rcpp::Named("zeroRates") = zeroRates);
+        //Rcpp::DataFrame frame = Rcpp::DataFrame::create(Rcpp::Named("date") = dates,
+        //                                                Rcpp::Named("zeroRates") = zeroRates);
+        Rcpp::List frame = Rcpp::List::create(Rcpp::Named("date") = dates,
+                                              Rcpp::Named("zeroRates") = zeroRates);
 
         Rcpp::List rl = Rcpp::List::create(Rcpp::Named("times") = tvec,
                                            Rcpp::Named("discounts") = disc,



More information about the Rquantlib-commits mailing list