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
Closed

Progress bars #17

hadley opened this issue Jul 19, 2012 · 2 comments

Comments

@hadley
Copy link
Member

@hadley hadley 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
Copy link
Contributor

@leeper leeper commented Mar 10, 2014

Loading

@hadley
Copy link
Member Author

@hadley hadley commented Jun 9, 2014

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

Loading

@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
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants