Debugger R does not stop at breakpoints

I run a script in R (using R Studio) that calls several nested functions (the script calls a function that has some code and then calls another function, etc.). I need to debug a function with several levels. I can enter the first function called by the script by putting a breakpoint on the line with the function call, and then entering the function. However, when I try to repeat this step to move on to the next function (having a breakpoint in the line for the next function call), R simply continues to execute the code until it finishes. Even using the continue command, which claims to continue execution to the next breakpoint.

I can go to other functions by going through the lines and then entering each function when I get it, but it will take me a lot of time to get to where I need to.

Any thoughts appreciated

+4
source share
1 answer

debugvery convenient for tasks of this kind. Say you want to perform a function step by step myfun. Just run debug(myfun)it before you run your code, and it will behave as if you had a breakpoint in the first line of this function.

, . , , .

+1

Source: https://habr.com/ru/post/1584092/


All Articles