Iterator Iterator - 1 year ago 85
R Question

Do any R IDEs support conditional breakpoints?

Which, if any, R IDEs (e.g. StatET, Revolution R, RStudio, ESS, NppToR, others) support conditional breakpoints?

This is available via

in the
package, or via an additional bit of code that invokes
based on a condition. However, it can be more efficient to be able to toggle a particular line # and quickly enter a conditional breakpoint for that particular line, without having additional code or console activities.

Note 1. I've searched a bit for these, and it seems that conditional breakpoints are not available in RStudio, and I think the same may be true for StatET. There appears to be support in ESS (see this page), though I'm not yet familiar with ess-tracebug and whether it's easy to use. It also seems that this works only for older versions of ESS; I'm not yet familiar with functionality for more recent versions.

Update 1. I'm selecting an answer (the only one - Andrie's). The question was answerable regarding whether any IDE supports conditional breakpoints, and, fortunately, Andrie has demonstrated that there exists a solution. I remain interested in any other IDEs that support this, though Eclipse is good enough for now. (At the moment, I prefer Rstudio, but this is already in their feature request list.) If anyone has expertise in ESS and can demonstrate that functionality, I'm sure it will benefit others who happen upon this question.

Answer Source

Yes, this is possible with Eclipse + StatET 2.0 in R 2.14-1.

Eclipse supports conditional debugging, and StatET 2.0 supports visual debugging (as long as you have a fairly recent version of R.)

Assuming you know your way around Eclipse, do the following:

  • Start a debugging session in Eclipse (i.e. invoke a Debug configuration, not a Run configuration)
  • Set a breakpoint in your code
  • Open a Debug perspective
  • Run your code

With the debug perspective open, you will have a pane that contains tabs for Variables / Breakpoints. In the breakpoints tab, select your breakpoint, then click the Conditional / Expression tickbox and enter your condition.

enter image description here

In searching for this answer, I found the following pages helpful:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download