Search code examples
rdebuggingrecover

R recover() stuck on "Enter a frame number, or 0 to exit "


I'm considering using recover() as an error option. but every time I hit an error, I am unable to do any interactive debugging because it just keeps telling me Enter a frame number, or 0 to exit no matter what I do (I have commented in full everything that I type after the error occurs):

> options(error = recover)
> foo <- function() {x <- "foo"; stop(x)}
> foo()
Error in foo() : foo

Enter a frame number, or 0 to exit   

1: foo()

### I type '1'
Selection: 1
Called from: top level 
Browse[1]> 

Enter a frame number, or 0 to exit   

1: foo()

### I type 'x'
Selection: x
Enter an item from the menu, or 0 to exit

### I type 'objects()'
Selection: objects()
Enter an item from the menu, or 0 to exit

### I type '0'
Selection: 0

### Recover exits and R returns to normal

The only thing it responds to appears to be '0' to exit recover(). Note that I did not press enter at Browse[1]> - it is simply skipped over and I don't get the chance to input anything.

What am I doing wrong?

I'm using R version 3.0.2 (2013-09-25) with Revolution R Enterprise IDE (x64) 7.0.0 under Windows 8.1

Edit

I think this is a problem to do with Revolution R IDE, as I tried this with the default RGui console and I could type stuff at Browse[1]> and therefore use recover successfully. If anyone with experience of Revolution R IDE has any further insight on this, I'd be most grateful.


Solution

  • I've submitted a bug report to Revolution Analytics, and so far this has been their reply:

    Milo,

    Thanks for the report. As I indicated, a defect has been filed with the development team. Running this code through the console works as expected and that only through the script window does it fail. I am closing the support ticket as there is no decision when this will be address.

    Regards,

    Brian Pinkney

    Manager, Revolution Analytics Technical Support

    I will update if they contact me again.