A few weeks ago I worked with breakpoints in Rstudio. It worked as I expected: stopping at breakpoints.
However, now I need to use it again, I can't get it to work; more specifically: when I set a breakpoint in Rstudio a red dot is appearing next to the code line (see screenshot), but when running the code, it does not stop at the break point.
I created a simple code example for this post to show what I want: run a for loop line for line.
Perhaps I am just not understanding something :) So, could anyone help me with getting these usefull debugging tools in Rstudio to work?
Thanks in advance.
If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.
c to leave the debug mode and continue with the regular execution of the function. Q to stop debug mode, terminate the function, and return to the R prompt.
You can use breakpoint commands to start your program up again. Simply use the continue command, or step , or any other command that resumes execution. Any other commands in the command list, after a command that resumes execution, are ignored.
The most common (and easiest) way to stop on a line of code is to set a breakpoint on that line. You can do this in RStudio by clicking to the left of the line number in the editor, or by pressing Shift+F9 with your cursor on the desired line. We call this an “editor breakpoint”.
Breakpoints also do not work for me on shiny app developed in RStudio, I am using browser()
instead of breakpoints, and it works.
see this
M
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With