Re: [R] Printing the loop number for each iteration

2011-07-21 Thread Jim Holtman
if using the GUI, turn off buffering, or use 'flush.console()' after 'cat'. Sent from my iPad On Jul 21, 2011, at 7:34, "Bogaso Christofer" wrote: > Hi all, I have a lengthy 'for' loop and for each loop I want to track the > iteration number that is currently going on. For this, I have tried >

[R] Printing the loop number for each iteration

2011-07-21 Thread Bogaso Christofer
Hi all, I have a lengthy 'for' loop and for each loop I want to track the iteration number that is currently going on. For this, I have tried following: > for (i in 1:10) { + DumDat <- rnorm(1000) + cat("iteration:", i, " \n") + } iteration: 1 iteration: 2 iteration: 3 iteration: 4