Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress bars #17

Closed
hadley opened this issue Jul 19, 2012 · 2 comments

Comments

@hadley
Copy link
Member

commented Jul 19, 2012

Possible in principle, but currently make it very easy to crash R.

library(httr)
down_progress <- function() {
  bar <- NULL

  function(down, up) {
    total <- down[1]
    if (total == 0) {
      cat(".")
      return()
    }

    current <- down[2]
    if (is.null(bar)) {
      bar <<- txtProgressBar(max = total)
    }
    setTxtProgressBar(bar, current)
  }
}
prg <- config(noprogress = 0L, progressfunction = down_progress())
x <- GET("http://courses.had.co.nz/12-oscon/slides.zip", prg)
x <- GET("https://dl.dropbox.com/u/41902/ggplot2-course.zip", prg)
@leeper

This comment has been minimized.

Copy link
Contributor

commented Mar 10, 2014

@hadley

This comment has been minimized.

Copy link
Member Author

commented Jun 9, 2014

Can't do safely (i.e. without risking of crashing R) until omegahat/RCurl#10 is fixed.

@hadley hadley closed this in 578144c Jun 9, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.