Is there a a way to disable all breakpoints in RStudio? I have looked at the RStudio documentation as well as done google searches but couldn't find a way.
If the code on which you're setting a breakpoint is executing but the breakpoint is not being hit, it's possible that the type of code does not yet support breakpoints. Here are two common cases: RStudio understands function assignments of the form:
RStudio's breakpoint functionality is built on R's trace infrastructure. It is possible to disable breakpoints in a function by calling untrace on the function, and also possible to disable all breakpoints by disabling tracing. This is not recommended since the IDE does not check for these manipulations.
To disable all breakpoints. You can disable all breakpoints in one of the following ways: On the Debug menu, click Disable All Breakpoints. On the toolbar of the Breakpoints window, click the Disable All Breakpoints button.
Editor breakpoints 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”.
It's right there under the Debug menu:
Default keyboard shortcut (on my system): Ctrl+Shift+F9
I was curious too, especially wanted to have an overview of breakpoints.
I ran grep
in my project folder and this is what I found:
At first, with RStudio opened, the breakpoints don't show up, they're probably somewhere in memory:
$ grep -inIEr "breakpoint" .
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:2: "debugBreakpointsState" : {
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:3: "breakpoints" : [
grep: ./.Rproj.user/1C48145B/sources/s-8EAA4F36/lock_file: Device or resource busy
Then when we close RStudio, it seems they're written to a file called debug-breakpoints.pper
$ grep -inIEr "breakpoint" .
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:2: "debugBreakpointsState" : {
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:3: "breakpoints" : [
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:10: "is_package_breakpoint" : false,
./.Rproj.user/1C48145B/pcs/debug-breakpoints.pper:25: "is_package_breakpoint" : false,
./.Rproj.user/1C48145B/pcs/find-in-files.pper:7: "query" : "breakpoint",
The file can be found at ./.Rproj.user/1C4***5B/pcs/debug-breakpoints.pper
and looks like this:
{
"debugBreakpointsState" : {
"breakpoints" : [
{
"editor_line_number" : 4,
"editor_state" : 1,
"function_name" : "toplevel",
"function_steps" : "",
"id" : 2,
"is_package_breakpoint" : false,
"is_pending_debug_completion" : false,
"line_number" : 4,
"needs_updated_steps" : false,
"package_name" : "",
"path" : "C:/Users/path/to/project/analysis_tab.R",
"state" : 1,
"type" : 1
},
{
"editor_line_number" : 193,
"editor_state" : 1,
"function_name" : "toplevel",
"function_steps" : "",
"id" : 3,
"is_package_breakpoint" : false,
"is_pending_debug_completion" : false,
"line_number" : 193,
"needs_updated_steps" : false,
"package_name" : "",
"path" : "C:/Users/path/to/project/analysis_tab.R",
"state" : 1,
"type" : 1
}
]
}
}
Manually editing this file when RStudio is closed lets us manage our breakpoints. (With RStudio opened, changes made to this file would eventually be overwritten).
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