Skip to content
Back to formatted view

Raw Message

Message-ID: <971536df0612280338r1ddab57v7ba7c2819213b9d6@mail.gmail.com>
Date: 2006-12-28T11:38:32Z
From: Gabor Grothendieck
Subject: How to debug R program?
In-Reply-To: <loom.20061228T122536-353@post.gmane.org>

On 12/28/06, Vladimir Eremeev <wl at eimb.ru> wrote:
> > Hi everyone:
>
> Please, refer to the chapter 9 of the "R language definition" ($R_HOME/doc/
> manual/r-lang.pdf)
>
> The simplest way is using print() functions.

Note that on Mac and Windows you may need to use flush.console() as well
if you intend to do this in a loop to be sure that the last print executed is
actually printed prior to the crash.  See ?flush.console

>
> Besides the debugging functions described in the manual, you can use the very
> powerful package debug, developed by Mark Bravington.
>
> >       I wrote a R program which has loops. When I run the program, it
> > crashed. I would like to identify in which loop the pragram crashed, how
> > can I debug ?  I'm new to R, could somebody please give me a general idea
> > about debugging in R.(I'm a C/C++ programmer and have general knowledge
> > about program debugging.)
> >      Thank you!
> >
> > Best,
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>