Displaying 1 result from an estimated 1 matches for "c4fe9451".
2001 Sep 27
2
on.exit
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