我正在考虑将recover()
其用作错误选项。但是每次我遇到错误时,我都无法进行任何交互式调试,因为Enter a frame number, or 0 to exit
无论我做什么它都会一直告诉我(我已经完整地评论了我在错误发生后键入的所有内容):
> 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
它唯一响应的似乎是 '0' to exit recover()
。请注意,我没有按 Enter 键Browse[1]>
- 它只是被跳过,我没有机会输入任何内容。
我究竟做错了什么?
我R version 3.0.2 (2013-09-25)
在 Windows 8.1 下使用 Revolution R Enterprise IDE (x64) 7.0.0
编辑
我认为这是与 Revolution R IDE 有关的问题,因为我使用默认的 RGui 控制台尝试了此操作,我可以在 at 处输入内容Browse[1]>
并因此recover
成功使用。如果任何有革命 R IDE 经验的人对此有任何进一步的见解,我将不胜感激。