[R] setting options only inside functions
biomathjdaily at gmail.com
Wed Apr 27 15:35:14 CEST 2011
There is probably a more elegant way to do this, but you could write
it into dummy1():
dummy1 <- function()
Alternatively, you could use ?tryCatch with the finally argument as a
call to options.
On Wed, Apr 27, 2011 at 9:16 AM, Jannis <bt_jannis at yahoo.de> wrote:
> Dear list members,
> is it possible to set some options only inside a function so that the original options are restored once the function is finished or aborted due to an error? Until now I do something like:
> This works for most cases but when the function terminates because of an error and its last command is not run, error=dummy1() still remains as an option. Is there any way around this?
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
# It's great, trust me.
More information about the R-help