R/withOptions.R

Defines functions withOptions

Documented in withOptions

withOptions <-
function(optlist, expr) {
  ## See the subsection ``Deep End'' on http://www.burns-stat.com/the-options-mechanism-in-r/
  oldopt <- options(optlist)
  on.exit(options(oldopt))
  expr <- substitute(expr)
  eval.parent(expr)
}
vlulla/vlutils documentation built on May 21, 2019, 12:35 a.m.