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

Duncan Murdoch murdoch at stats.uwo.ca
Mon Jun 1 07:34:01 CEST 2009


David Winsemius wrote:
> On May 31, 2009, at 12:22 AM, Duncan Murdoch wrote:
>
>   
>> David Winsemius wrote:
>>     
>>> You are wiping out all of the default options with that approach.
>>>
>>>
>>>       
>> Actually, I think it hid the options() function.
>>     
>
> Since I was doing this at the RGui and became concerned that it  
> appeared I no longer had any options, I restarted.  Could I have saved  
> time by just executing rm(options)?
>   

Yes.
>   
>>> 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
>>>
>>>       
>> Not if you run it in the console, but it is needed in .Rprofile.
>>     
>
> Because it might be executed before the loading of the default packages?
>   
I think ?Startup documents it to do just that.  I didn't check the 
actual source or test it, but usually the docs are right, even if 
sometimes they aren't.

Duncan Murdoch




More information about the R-help mailing list