[R] Tracking progress during iterations

Gabor Grothendieck ggrothendieck at gmail.com
Tue May 24 13:37:25 CEST 2005


On 5/24/05, Dr L. Y Hin <lyhin at netvigator.com> wrote:
> Dear all,
> I am using R 2.1.0 for Windows on XP SP2.
> In a loop such as below, we can track the progress by a screen print display as
> below (in S):
> 
> for (i in 1:10){
> print(paste("Starting simulation run no...",i))
> 
>    result<-c(result,mean(data)) #A dummy example of the simulation to be done
> 
> }
> 
> In S-plus environment, the statements
> 
> Starting simulation run no...1
> Starting simulation run no...2
> .
> .
> .
> etc.,
> 
> are displayed as the loop is running.  However,
> in R, they are displayed only after the loop is completed.
> Is there anyway to 'make it' appear as the loop is running?
> 


See 6.3 of the R Windows FAQ:
http://cran.r-project.org/bin/windows/base/rw-FAQ.html




More information about the R-help mailing list