Wednesday, August 10, 2011

Making a progress bar for long R programs

From : http://ryouready.wordpress.com/2009/03/16/r-monitor-function-progress-with-a-progress-bar/

total <- 20
# create progress bar
pb <- txtProgressBar(min = 0, max = total, style = 3)
for(i in 1:total){
Sys.sleep(0.1)
# update progress bar
setTxtProgressBar(pb, i)
}
close(pb)

No comments:

Post a Comment