Re: [R] Displaying Iteration Count

From: Sarah Goslee <>
Date: Tue, 22 Jun 2010 09:19:01 -0400

You can use cat() to print something during a loop. The help for for() even gives an example.


On Tue, Jun 22, 2010 at 9:07 AM, Downey, Patrick <> 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.
> Thanks,
> Mitch

Sarah Goslee mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Tue 22 Jun 2010 - 13:23:28 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 22 Jun 2010 - 13:30:34 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive