Wrapper to FOR loops with progress bar
I like to use a progress bar while running slow for loops. This could be done easily with several helpers, but I do like the tkProgressBar from tcltk package. A small example: pb <- tkProgressBar(title = "Working hard:", min = 0, max = length(urls), width = 300) for (i in 1:300) { # DO SOMETHING Sys.sleep(0.5) setTkProgressBar(pb, i, label=paste( round(i/length(urls)*100, 0), "% ready!")) } close(pb) And I would like to set up a small function to store in my .Rprofile named to forp (as: for loop with progressbar), to call just like for but with auto added progress bar - but unfortunately have