Skip to content
Prev 44284 / 63421 Next

setting option in function

old_options <- options(na.action=na.fail)
on.exit(options(old_options))

You can also use this to define a wrapper that executes an expression
using special options

withOptions<-function(optlist,expr){
        oldopt<-options(optlist)
        on.exit(options(oldopt))
        expr<-substitute(expr)
        eval.parent(expr)
        }


    -thomas
On Sat, Oct 20, 2012 at 10:35 AM, Charles Geyer <charlie at stat.umn.edu> wrote: