Skip to content
Prev 181915 / 398513 Next

'options=utils::recover' not working in .Rprofile or within R

[Sent this before completing my last sentence; here's another attempt]
On 29/05/2009 11:45 PM, Mark Kimpel wrote:
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