Skip to content

Instantly share code, notes, and snippets.

@aaronberdanier
Created April 11, 2012 19:51

Revisions

  1. @invalid-email-address Anonymous created this gist Apr 11, 2012.
    13 changes: 13 additions & 0 deletions progressBar.r
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    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