[R] on.exit

kjetil halvorsen kjetilh at umsanet.edu.bo
Thu Sep 27 19:05:01 CEST 2001


Hola!

look at the following:

> test <- function() {
+    options(warn=-1)
+    on.exit( options(warn=0))
+    log(-1)
+ }
> test()
[1] NaN


but what should be better, doesnt work:

> test1 <- function() {
+    oldwarn <- options("warn")
+    options(warn=-1)
+    on.exit( options(warn=oldwarn))
+    log(-1)
+ }
> test1()
Error in options(...) : warn parameter invalid
> 


What is wrong? (I have tried other versions, without success)

Kjetil Halvorsen.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list