Visual debugging with RIDE
(This help page is extracted from Alex Tugarev's blog - https://r-brain.io/en/blog/visual-debugging-with-ride/)
RIDE is a Jupyter-based development environment for R and Python, which provides integration of visual debugging features, such as using breakpoints in code editor, stepping through code, and inspecting variables.
Setting breakpoints in RIDE is as easy as clicking on the left hand side of an editor. There is instant feedback on the status of a breakpoint. If a breakpoint cannot be set, you will see a grey circle, e.g. in case the opened R file has not yet been sourced. Check the convenient option 'Automatically Source File on Save' in editor's toolbar.
All breakpoints are shown in the BREAKPOINTS section in the environment view. If you switch to another kernel session, e.g. by starting a new console, all managed breakpoints are set automatically.
You can even set breakpoints in the code of installed packages. Just open an editor of a function, e.g. by double-clicking in the VARIABLES section. Set a breakpoint on a line where next execution of this function should be paused as if it was your code.
When a breakpoint is reached and execution of code is paused, the Environment view is revealed automatically and you will see the call stack.
CALL STACK Section
Clicking on any entry in the CALL STACK section will reveal and highlight the corresponding location in the code editor. The topmost frame gets revealed automatically on each step during debugging.
In the header you will find the typical actions to control the debugger, such as ‘Continue’, ‘Stop’, ‘Step Over’, ‘Step In’, and ‘Step Out’.
The VARIABLES section is used to inspect the values and functions of the global and all package environments. During a paused debugging session it also shows the environments of the currently selected frame from the call stack.
One general advantage of RIDE’s variable browser is, that it allows drill-down into contents of variables, which I find very useful when working with dataframes, local environments or R6 classes.