遇到bug差点重装R,以下代码可以快速解决问题
> 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