Skip to content

Instantly share code, notes, and snippets.

@aaronberdanier
Created April 11, 2012 19:51
Show Gist options
  • Save aaronberdanier/2361922 to your computer and use it in GitHub Desktop.
Save aaronberdanier/2361922 to your computer and use it in GitHub Desktop.
Progress bar in R
ng <- 1000
# create the progress bar
prog <- txtProgressBar(min=0, max=ng, char="*", style=3)
for(g in 1:ng){
# do stuff
z <- numeric(10000)
z <- rgamma(10000, 1, 1)
setTxtProgressBar(prog, g) # update the progress bar
}
close(prog) # close the progress bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment