[R] cat function within a loop

Tatsuki Koyama Tatsuki.Koyama at Vanderbilt.edu
Tue Oct 5 16:48:38 CEST 2004


I have a 'cat' function within a for loop.
I would like it to print out the result everytime it goes through the
for loop so that I can monitor the progress, but it only prints out
(execute the cat function) once at the very end of the for loop.
A simple example:

for(i in 1:100000){
	cat(i, '\n')
}

What should I do in order for the cat function to be executed
everytime it goes thorough the for loop?
Thanks!




More information about the R-help mailing list