It is pretty easy to monitor the progress of a long loop in R using the original txtProgressBar function in the utils package.
It works like this:
mypb <span><-</span> txtProgressBar<span>()</span>
m <span><-</span> sapply<span>(</span><span>1</span><span>:</span><span>1000</span><span>,</span> <span>function</span><span>(</span>x<span>)</span> <span>{</span>
setTxtProgressBar<span>(</span>mypb<span>,</span> x<span>/</span><span>1000</span><span>)</span>
mean<span>(</span>rnorm<span>(</span>x<span>))</span>
<span>})</span>
close<span>(</span>mypb<span>)</span>
You could even get a GUI-type output using tkProgressBar from the tcltk package, or winProgressBar.
Or you could build your own. The ...
[Read more...]