[R] Displaying Iteration Count

Duncan Murdoch murdoch.duncan at gmail.com
Tue Jun 22 15:36:03 CEST 2010


On 22/06/2010 9:14 AM, jim holtman wrote:
> Just put the code in yourself; use 'cat' with a test to print every
> 'n' iterations.  You can also check out the 'winProgressBar' in the
> plyr package.
>
>   

In Windows (and other GUIs?) console output is buffered, so by default 
the results won't appear until the end.  However, you can change this; 
in Windows you use the Misc | Buffered output menu item (or Ctrl-W), or 
make a call to flush.console() as Henrique showed.

Duncan Murdoch
> On Tue, Jun 22, 2010 at 9:07 AM, Downey, Patrick <PDowney at urban.org> wrote:
> > Hello,
> >
> > I'm running a very long for loop that usually takes hours. For my own piece
> > of mind, it would be nice if I could check periodically and see which
> > iteration the loop is on. A line of code that told R to print the iteration
> > number every 100 or 200 iterations would be perfect.
> >
> > Does anyone know something like this? I've never known how to print
> > anything within a for loop before the loop ends.
> >



More information about the R-help mailing list