options(error=utils::recover)

Does indeed work, at least with the new install of R-devel (to be 2.10.0)
that I am running right now. I was sure I checked this with 2.9.0 last
night, but I am probably mistaken.

One point, the ?options help page is misleading in that the example is "
Note that these need to
          specified as e.g. 'options=utils::recover' in startup files
          such as '.Rprofile'."

Since the use of "utils::" is a new requirement, I think stemming from when
utils is loaded, this help page should be corrected as the example is
confusing/incorrect.

So, stick with what is in the first line above and, for now, ignore the help
page.

Mark
------------------------------------------------------------
Mark W. Kimpel MD  ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine

15032 Hunter Court, Westfield, IN  46074

(317) 490-5129 Work, & Mobile & VoiceMail
(317) 399-1219  Home
Skype:  mkimpel

"The real problem is not whether machines think but whether men do." -- B.
F. Skinner
******************************************************************


On Sat, May 30, 2009 at 10:49 PM, David Winsemius <dwinsemius@comcast.net>wrote:

> You are wiping out all of the default options with that approach.
>
> Try (after restarting R to get the other options back to what they should
> be):
>
> op=options()                   # so you can reset back to baseline
> options(error=utils::recover)  # do not think the "utils::" is needed
>  my.func <- function(x){
>  y <- x + 12
>  nonsense
>  y
>  }
>
>  my.func(14)
> Error in my.func(14) : object "nonsense" not found
>
> Enter a frame number, or 0 to exit
>
> 1: my.func(14)
>
> Selection:
>
>
>
> On May 30, 2009, at 10:24 PM, Mark Kimpel wrote:
>
>  Duncan,
>>
>> I've pared down my .Rprofile so that it has just the options line, started
>> R
>> from terminal (instead of using ESS-emacs) and I still have the problem.
>> Am
>> I specifying the options incorrectly? I believe I took this directly from
>> the help page.
>>
>
> Not what the examples look like on my machine.
>
>
>  See my output of .Rprofile, the code example that doesn't
>> work as we think it ought, and my sessionInfo().  Thanks, Mark
>>
>> Type 'demo()' for some demos, 'help()' for on-line help, or
>> 'help.start()' for an HTML browser interface to help.
>> Type 'q()' to quit R.
>>
>>  read.table("~/.Rprofile")
>>>
>>                     V1
>> 1 options=utils::recover
>>
>>> my.func <- function(x){
>>>
>> + y <- x + 12
>> + nonsense
>> + y
>> + }
>>
>>> my.func(14)
>>>
>> Error in my.func(14) : object 'nonsense' not found
>>
>>> sessionInfo()
>>>
>> R version 2.9.0 (2009-04-17)
>> x86_64-unknown-linux-gnu
>>
>> locale:
>>
>> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>>>
>>>
>>
> David Winsemius, MD
> Heritage Laboratories
> West Hartford, CT
>
>

	[[alternative HTML version deleted]]


