R - txtProgressBar() and setTxtProgressBar(): progress bar for a loop

26 Aug 2017

create a progress bar for a loop and print the progress during the loop:

SEQ  <- seq(1,100)
pb   <- txtProgressBar(1, 100, style=3)
for(i in SEQ){
   Sys.sleep(0.02)
   setTxtProgressBar(pb, i)
}

viewed on http://www.rfunction.com/

[ R  loop  function  ]