Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable all breakpoints in RStudio

Tags:

rstudio

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.

like image 844
Salil Surendran Avatar asked Oct 05 '15 22:10

Salil Surendran


People also ask

Why can't I set breakpoints in RStudio?

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:

How do I disable breakpoints in an R function?

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.

How do I disable all breakpoints in Visual Studio?

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.

How do I stop on a specific line in R studio?

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”.


2 Answers

It's right there under the Debug menu: enter image description here

Default keyboard shortcut (on my system): Ctrl+Shift+F9

like image 77
Ofek Shilon Avatar answered Oct 22 '22 14:10

Ofek Shilon


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).

like image 38
Aurèle Avatar answered Oct 22 '22 14:10

Aurèle