[R] Download large file from https url with progress meter

Gregory Jefferis jefferis at gmail.com
Tue Jul 10 22:09:49 CEST 2012


Dear useRs,

I would like to download a large (15Mb) file from a github https url with a progress meter. My first attempt was:

zip_url="https://github.com/jefferis/AnalysisSuite/zipball/master"
zip_file=tempfile()
> download.file(zip_url,zip_file)
Error in download.file(zip_url, zip_file) : unsupported URL scheme

Then I tried
install.packages("httr")
require(httr)

system.time(request<-GET(zip_url, config(ssl.verifypeer = FALSE)))
stop_for_status(request)
writeBin(content(request),zip_file)

   user  system elapsed 
  1.234   0.236  27.685 

I can't seem to find a way for the httr package to show progress. Can anyone suggest an alternative approach?

With many thanks,

Greg Jefferis.

--
Gregory Jefferis, PhD                      
Division of Neurobiology                   
MRC Laboratory of Molecular Biology,       
Hills Road,                                
Cambridge, CB2 0QH, UK.                    

http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis
http://www.neuroscience.cam.ac.uk/directory/profile.php?gsxej2
http://flybrain.stanford.edu



More information about the R-help mailing list