[R] program never enters browser mode when I add browser()

Joshua Wiley jwiley.psych at gmail.com
Sat Oct 29 04:33:32 CEST 2011


Hi Michelle,

In addition to Jeff's advice, can you now reproduce the original
error?  What you are describing is highly improbable if everything is
properly executed.  It becomes more likely if more was chagned between
running than just inserting browser().  For example, if you reran/had
made changes in other code you forgot to run and then sourced that
into R in addition to having added browser() to bigfunction.  If
browser() was really run, it should have come up, perhaps somewhere in
.... is something made the function return a value and terminate or
your code is written in such a way that the portion that browser() was
in was not run.

Right now this is all just speculation, further help will really
require more details to work with.

Cheers,

Josh

On Fri, Oct 28, 2011 at 12:04 PM, M. Tran <michellev.tran at gmail.com> wrote:
> Dear All
>
> I have a program that breaks at the following lines of code:
>
> bigfunction =
> {
> ...
>
> object1 = myfunction(x)
> object2 = strsplit(object1, ",")[[1]]
>
> ...
> }
>
> where myfunction is defined elsewhere outside of bigfunction.
>
> The error I get is "error in strsplit() -- object1 not found".
>
> However, when I insert browser() into my code so that the above reads,
>
> bigfunction =
> {
> ...
>
> browser()
> object1 = myfunction(x)
> object2 = strsplit(object1, ",")[[1]]
>
> ...
> }
>
> my entire program runs successfully, and oddly *never enters browser mode*.
>
> Has anyone encountered a similar problem?  Any advice would be greatly
> appreciated.
>
> Thank you,
> Michelle
>
> --
> View this message in context: http://r.789695.n4.nabble.com/program-never-enters-browser-mode-when-I-add-browser-tp3948920p3948920.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org 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.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, ATS Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/



More information about the R-help mailing list