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. 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
>

------------------------------------------------------------
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 5:44 AM, Duncan Murdoch <murd...@stats.uwo.ca>wrote:

> [Sent this before completing my last sentence; here's another attempt]
>
> On 29/05/2009 11:45 PM, Mark Kimpel wrote:
>
>> For years I have been using options(error = recover) either in .Rprofile
>> or
>> from within R for debugging purposes. The functionality of this appears to
>> have changed and I can't recover it (no pun intended) using the ?options
>> help page. How can I get the old functionality back, particularly from
>> within .Rprofile? A specific line entry would be appreciated. An example,
>> the help page, and sessionInfo() follow. Thanks, Mark
>>
>
> I don't think there were any substantial changes in 2.9.0, so I would
> guess that you have a local object named "recover" or "options", and it
> is causing your  problems.  When I run options(error=recover) and your
> two lines below, I get this output:
>
>  > options(error=recover)
>  > b.func <- function(x) {y <- x + 2; nonsense; y}
>  > b.func(3)
> Error in b.func(3) : object 'nonsense' not found
>
> Enter a frame number, or 0 to exit
>
> 1: b.func(3)
>
> Selection: 0
>  >
>
> which is what you wanted.
>
> To put this into your .Rprofile, you need to use utils::recover (the
> utils package hasn't been attached yet).  That also works for me.
>
> There have been changes to recover in R-devel (to become 2.10.0), and will
> likely be more, but what you did shouldn't appear much different than what I
> showed from 2.9.0 above.  If you had sourced the code from a file, 2.10.0
> should tell you which line of the file contained the error.
>
> Duncan Murdoch
>
>
>
>> b.func <- function(x) {y <- x + 2; nonsense; y}
>>
>>> b.func(3)
>>>
>> Error in b.func(3) : object 'nonsense' not found ## in the past this would
>> be a menu with numbers for what level I want to go to (in this case just
>> 1)
>>
>> This help page states:
>> 'error': either a function or an expression governing the handling
>>          of non-catastrophic errors such as those generated by 'stop'
>>          as well as by signals and internally detected errors... The
>>          functions 'dump.frames' and 'recover' provide alternatives
>>          that allow post-mortem debugging.  Note that these need to
>>          specified as e.g. 'options=utils::recover' in startup files
>>          such as '.Rprofile'.
>>
>>  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 datasets  utils     methods   base
>> ------------------------------------------------------------
>> 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
>> ******************************************************************
>>
>>        [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to