[R] basic debugging

Bert Gunter gunter.berton at gene.com
Thu Feb 9 06:43:58 CET 2012


?options  ## error = recover will allow you to browse state at the
point of error
?traceback  ## invoke immediately after an error to see exactly in
which function the error occurred

-- Bert

On Wed, Feb 8, 2012 at 9:01 PM, ilai <keren at math.montana.edu> wrote:
> ?debug will satisfy your curiosity regarding "debug mode"  - strictly
> speaking it is not a "mode", just another function.
>
>
> On Wed, Feb 8, 2012 at 7:30 PM, R. Michael Weylandt
> <michael.weylandt at gmail.com> wrote:
>> What is your question? More interestingly, what is "debug mode" in R?
>>
>> I'd suggest you look at traceback() -- there's also the powerful, but
>> possibly advanced, options(error=recover)
>>
>> Kerninghan said "The most effective debugging tool is still careful
>> thought, coupled with judiciously placed print statements." It's good
>> advice, particularly for debugging something in a loop.
>>
>> Michael
>>
>> On Wed, Feb 8, 2012 at 5:25 PM, ikuzar <razuki at hotmail.fr> wrote:
>>> Hi,
>>>
>>> I have to debug my program. When I execute my function (in debug mode), I
>>> have got an error but I do not know which line is concerned. I do not want
>>> to do an infinite "Browse[2]>n  with each line in my function...
>>>
>>> THanks for your help,
>>>
>>> ikuzar
>>>
>>> --
>>> View this message in context: http://r.789695.n4.nabble.com/basic-debugging-tp4371113p4371113.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.
>>
>> ______________________________________________
>> 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.
>
> ______________________________________________
> 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.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm



More information about the R-help mailing list