Skip to content

Instantly share code, notes, and snippets.

@dsparks
Last active September 25, 2015 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsparks/838788 to your computer and use it in GitHub Desktop.
Save dsparks/838788 to your computer and use it in GitHub Desktop.
Example of a text progress bar.
# Alternatively
library(dplyr)
p <- progress_estimated(3)
for (i in 1:3) p$pause(0.1)$tick()$print()
total <- 100
# create progress bar
pb <- txtProgressBar(min = 0, max = total, style = 3)
TheFunction <- function(i){
Sys.sleep(0.05)
setTxtProgressBar(pb, i)
}
lapply(1:total, TheFunction)
close(pb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment