class

Progress bar widget in R and Racket

As an impatient person and an insecure programmer, I typically use progress bars for any code that takes more than a few minutes to run. In R, a progress bar widget is available through the tcltk package. library(tcltk) pb <- tkProgressBar(title = "Progress Bar", label = "0%", max = 100) for(i in 1:100) { Sys.sleep(0.05) setTkProgressBar(pb, value = i, label = paste0(i, "%")) } close(pb) In this code, we initialize a progress bar and assign it to pb.