title: Download failed while using quantmod function getSymbols in For loop
body: <p>I am trying to get data for the 1632 stocks that comprise the NSE index in India using the <code>quantmod</code> package. I am able to download stocks individually; however, when I loop over all the stocks, I am getting a timeout. How do I loop the <code>getSymbols</code> function to download the desire data? </p>
  
  <p>Following error is reported: </p>
  
  <blockquote>
    <p>Error: '20MICRONS.NS' download failed after two attempts. Error message:
    HTTP error 404. 
    5.
    stop(Symbols.name, " download failed after two attempts. Error", 
        " message:\n", attr(dl, "condition")$message, call. = FALSE) 
    4.
    getSymbols.yahoo(Symbols = "'20MICRONS.NS'", env = , 
        verbose = FALSE, warnings = TRUE, auto.assign = TRUE) 
    3.
    do.call(paste("getSymbols.", symbol.source, sep = ""), list(Symbols = current.symbols, 
        env = env, verbose = verbose, warnings = warnings, auto.assign = auto.assign, 
        ...))
    2.
    getSymbols(as.character(x), src = "yahoo") 
    1.
    f(Symbol[i]) </p>
  </blockquote>
  
  <pre><code>MyData &lt;- read.csv(file="C:/Documents/EQUITY_L.csv", header=TRUE)
  Symbol &lt;- MyData$SYMBOL
  
  f &lt;- function(x) { getSymbols(as.character(x), src='yahoo') }
  for (i in 1:1632) { f(Symbol[i]) }
  </code></pre>