title: R - Running download.file script in multiple threads
body: <p>I have to download NYSE historical end of day prices from Yahoo Finance for all stocks in NYSE. This is the working script which is taking almost 20 minutes to download data for 600+ stocks. I have powerful server and would like download these in parallel. How can I do that?</p>
  
  <pre><code>for(val in stocks$V1) {
    url &lt;- paste(paste("http://real-chart.finance.yahoo.com/table.csv?s=", val, sep=""), "&amp;a=11&amp;b=12&amp;c=1980&amp;d=9&amp;e=28&amp;f=2015&amp;g=d&amp;ignore=.csv", sep="")
    file_name &lt;- paste(paste("/Users/usdgadiraj/Research/BigData/data/nyse/rscript/", val, sep=""), ".csv", sep="")
    download.file(url, file_name)
  }
  </code></pre>