Skip to content
Prev 56808 / 398498 Next

cat function within a loop

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!