# R Line Breakpoints

Line breakpoints are the most usual breakpoints set to a line a R source file. Beside the common case of breakpoints inside a function definition (), line breakpoints can be also set outside of function definition to toplevel commands in the R script. These toplevel breakpoints are indicated in the icon by an overlaid prompt symbol (). Toplevel breakpoints are never installed, they are directly handled when submitting code in StatET.

#### Adding Line Breakpoints

To create a new line breakpoint, open the file in a the source editor and:

- By using the Toggle Line Breakpoint command:
  1. Set the cursor inside at any position inside the definition of the function the breakpoint should be associated to.
  2. Trigger the command Toggle Method Breakpoint.
  This way ensures that a line breakpoint and not another type is created.
- Use the action Toggle Breakpoint in the context menu of the editor ruler in the line you want to set the breakpoint. You can also double-click on the editor ruler to execute this command.

  Note that this way creates in special contexts other breakpoints than a line breakpoint, for example in line with function header a method breakpoint.

- By using the common Toggle Breakpoint command:
  1. Set the cursor inside the header of the function the breakpoint should be associated to.
  2. Trigger the common command Toggle Breakpoint.
  The keyboard shortcut `Ctrl+Shift+B` is associated by default to this command.

  Note that this way creates in special contexts other breakpoints than a line breakpoint, for example in line with function header a method breakpoint.

#### Removing Line Breakpoints

Since the ways to create a line breakpoint described above are toggle operation, you can also use them again to remove the line breakpoint. Beside that, the Breakpoint view offers additional actions to remove the selected or all breakpoints.