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
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.
__
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
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
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
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
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
>
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
8 matches
Mail list logo