[Rquantlib-commits] r234 - pkg/RQuantLib/inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Apr 22 04:16:53 CEST 2010


Author: edd
Date: 2010-04-22 04:16:52 +0200 (Thu, 22 Apr 2010)
New Revision: 234

Modified:
   pkg/RQuantLib/inst/unitTests/runitOptions.R
Log:
switch to expanded form of textConnection to get rid of warnings about unclosed connections


Modified: pkg/RQuantLib/inst/unitTests/runitOptions.R
===================================================================
--- pkg/RQuantLib/inst/unitTests/runitOptions.R	2010-04-22 01:21:38 UTC (rev 233)
+++ pkg/RQuantLib/inst/unitTests/runitOptions.R	2010-04-22 02:16:52 UTC (rev 234)
@@ -50,7 +50,9 @@
 put  100.00 110.00 0.10 0.10 0.50 0.35  5.8823"
 
     ## now loop over all tests -- note that we need a fairly loose tolerance value
-    Params <- read.delim(textConnection(Lines), sep="")
+    con <- textConnection(Lines)
+    Params <- read.delim(con, sep="")
+    close(con)
     for (i in NROW(Params)) {
         P <- Params[i,]
         rc <- AmericanOption(type=as.character(P$type), underlying=P$spot, strike=P$strike,
@@ -161,7 +163,9 @@
 upin       105.0     3.0   put    110  100.0  0.04  0.08  0.50  0.30   8.3686  1.0e-4"
 
     ## now loop over all tests -- note that we need a fairly loose tolerance value
-    Params <- read.delim(textConnection(Lines), sep="")
+    con <- textConnection(Lines)
+    Params <- read.delim(con, sep="")
+    close(con)
     for (i in NROW(Params)) {
         P <- Params[i,]
         rc <- BarrierOption(barrType=as.character(P$barrierType), type=as.character(P$type), underlying=P$spot, strike=P$strike,
@@ -236,7 +240,9 @@
 call  40.00  42.00 0.08 0.04 0.75 0.35  5.0975 1.0e-4"
 
     ## now loop over all tests -- note that we need a fairly loose tolerance value
-    Params <- read.delim(textConnection(Lines), sep="")
+    con <- textConnection(Lines)
+    Params <- read.delim(con, sep="")
+    close(con)
     for (i in NROW(Params)) {
         P <- Params[i,]
         rc <- EuropeanOption(type=as.character(P$type), underlying=P$spot, strike=P$strike,



More information about the Rquantlib-commits mailing list