Created
April 11, 2012 19:51
-
-
Save aaronberdanier/2361922 to your computer and use it in GitHub Desktop.
Progress bar in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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