Re: [R] Displaying Iteration Count

2010-06-22 Thread Paul
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

Re: [R] Displaying Iteration Count

2010-06-22 Thread Filoche
for (i in 1:1) { if( (i - 100) %%100 == 0) print(i); } -- View this message in context: http://r.789695.n4.nabble.com/Displaying-Iteration-Count-tp2264088p2264124.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Displaying Iteration Count

2010-06-22 Thread Duncan Murdoch
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 un

Re: [R] Displaying Iteration Count

2010-06-22 Thread Shotwell, Matthew S
un...@r-project.org] On Behalf Of Henrique Dallazuanna [www...@gmail.com] Sent: Tuesday, June 22, 2010 9:15 AM To: Downey, Patrick Cc: R help Subject: Re: [R] Displaying Iteration Count Try this: for(i in 1:10) { print(sprintf("Interation: %d", i)) flush.console() Sys.sleep

Re: [R] Displaying Iteration Count

2010-06-22 Thread Henrique Dallazuanna
Try this: for(i in 1:10) { print(sprintf("Interation: %d", i)) flush.console() Sys.sleep(1) } On Tue, Jun 22, 2010 at 10: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 chec

Re: [R] Displaying Iteration Count

2010-06-22 Thread Sarah Goslee
You can use cat() to print something during a loop. The help for for() even gives an example. Sarah 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 period

Re: [R] Displaying Iteration Count

2010-06-22 Thread jim holtman
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. 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 >

[R] Displaying Iteration Count

2010-06-22 Thread Downey, Patrick
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 kno