Cannot inspect variables within the debugger

I have enabled options(error = browser) and try to debug some numeric issue (matrix not invertible due to lacking positive-definiteness). As you can see in the first screenshot the debugger allows me to go to the right stack frame from the “traceback” panel. Unfortunately I cannot show you the screenshot here because I am a new user and only one image is allowed. Too bad. There is an object x in the scope where the error occurs.

But trying to interact with the object x in there via str(x), View(x), image(x) or just x fails with either

Error in View : object 'x' not found

or

Error during wrapup: object 'x' not found

as you can see in this screenshot:

Also it throws me back to the top frame.

This breaks the debugger pretty much completely. I am using RStudio version 1.2.5001 and this issue has already been present in a 1.1 version I believe.

Why do you think object x exists? From your screenshot it's difficult to say whether that's the case.

Also, what happens if you put browser() directly in your code? Does it work this way?

The x exists in the right frame. I could just not upload both images in my initial post.

Having browser() in the code has the big disadvantage that it will trigger right away and not in the like 50th iteration of a loop which contains the problematic entry. I would have to add a clause to the browser() such that it becomes useful again.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.