You could just use debug(f) and then when the Browser opens and the loop begins 
type 'c', that jumps over the loop to next line after the loop. 

Best

Simon

On Sep 16, 2013, at 9:05 PM, Hui Du <[email protected]> wrote:

> Hi All,
> 
> I need some help regarding how to set up a breakpoint in debug. For example, 
> I have a very simple/naïve function (a useless function just for demo)
> 
> f = function()
> {
>    x = 10;
>    len = 100;
> 
>    a = 1;
>    for(i in 1:len)
>    {
>        a = a * i;
>    }
> 
> y = x + a;
> y;
> }
> 
> 
> If I need to debug it, I can run debug(f). After I go into the debugger, if I 
> want to skip the loop and stop in the statement y = y + a, directly, how to 
> do that? I know R has a function named setBreakpoint but I have never used it 
> correctly.
> 
> Your help is highly appreciated.
> 
> HXD
> 
>       [[alternative HTML version deleted]]
> 
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to