When debugging a function, I would like to move up to the parent frame and look at some variables there. How do I do this?
Here is a sample:
f <- fun
You can use recover
(it is often used to debug code after an actual error,
via options(error=utils::recover)
,
but it can be called directly).
> f()
debugging in: g(x + 1)
debug at #1: {
y = z + 2
return(y)
}
Browse[2]> ls()
[1] "z"
Browse[2]> recover()
Enter a frame number, or 0 to exit
1: f()
2: #3: g(x + 1)
Selection: 1
Called from: top level
Browse[3]> ls()
[1] "x"
Browse[3]> x
[1] 1
Browse[3]>