Skip to content
Prev 181914 / 398513 Next

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

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,

Duncan Murdoch