[R] Set Conditional Breakpoint with setBreakpoint Function
murdoch.duncan at gmail.com
Fri Jul 25 13:31:08 CEST 2014
On 25/07/2014, 6:52 AM, marcel Austenfeld wrote:
> i'm searching for a way to realize a conditional breakpoint.
> setBreakpoint is a simple wrapper for the trace function. What i wan't to do
> is similar to the trace function
> described here:
> "> trace(fun, quote(if (x > 10) browser()))"
> How can i do this with the setBreakpoint function or are there any other
> alternatives to realize a conditional breakpoint?
> I use the setBreakpoint function in combination with findLineNum for a
> simple R debugging GUI.
> Thank in advance for any help
The conditional in the trace example is the tracer argument.
setBreakpoint also has a tracer argument; have you tried that? E.g.
setBreakpoint("foo.R#22", tracer=quote(if (x > 10) browser()))
More information about the R-help