[R] Help! Big problem when using "browser()" to do R debugging?
landronimirc at gmail.com
Sat Dec 3 09:15:56 CET 2011
On Sat, Dec 3, 2011 at 2:38 AM, Michael <comtech.usa at gmail.com> wrote:
> Hi all,
> Could you please help me?
> I am having the following weird problem when debugging R programs
> using "browser()":
> In my function, I've inserted a "browser()" in front of Step 1. My
> function has 3 steps and at the end of each step, it will print out
> the message "Step i is done"...
> However, after I hit <ENTER> when the program stopped before Step 1
> and entered into the debugging mode, it not only executed the next
> line(i.e. the Step 1), but also all the (many) remaining lines in that
> function, as shown below:
>  "Step 1 is done.."
>  "Step 2 is done.."
>  "Step 3 is done.."
> Then it automatically quited the debugging mode and when I tried to
> check the value of "myobj", I've got the following error message:
> Error: object 'myobj' not found
> No suitable frames for recover()
> So my question is: why did one key stroke <ENTER> lead it to execute
> all the remaining lines in that function and then "returned" from the
> function and quited the debugging mode?
As soon as you get into 'debug' mode, type 'n', hit <enter>, then you
can simply hit <enter> to evaluate the fun step by step. To exit the
step-by-step, type 'c' and hit enter: this will evaluate the rest of
> Thanks a lot!
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Do you know how to read?
Do you know how to write?
More information about the R-help