title: getSymbols downloading data for multiple symbols and calculate returns
body: <p>I'm currently downloading stock data using GetSymbols from the Quantmod package and calculating the daily stock returns, and then combining the data into a dataframe. I would like to do this for a very large set of stock symbols. See example below. In stead of doing this manually I would like to use a For Loop if possible or maybe use one of the apply functions, however I can not find the solution.</p>
  
  <p>This is what I currently do:</p>
  
  <pre><code>Symbols&lt;-c  ("XOM","MSFT","JNJ","GE","CVX","WFC","PG","JPM","VZ","PFE","T","IBM","MRK","BAC","DIS","ORCL","PM","INTC","SLB")
  length(Symbols)
  
  #daily returns for selected stocks &amp; SP500 Index
  SP500&lt;-as.xts(dailyReturn(na.omit(getSymbols("^GSPC",from=StartDate,auto.assign=FALSE))))
  S1&lt;-as.xts(dailyReturn(na.omit(getSymbols(Symbols[1],from=StartDate,auto.assign=FALSE))))
  S2&lt;-as.xts(dailyReturn(na.omit(getSymbols(Symbols[2],from=StartDate,auto.assign=FALSE))))
  S3&lt;-as.xts(dailyReturn(na.omit(getSymbols(Symbols[3],from=StartDate,auto.assign=FALSE))))
  S4&lt;-as.xts(dailyReturn(na.omit(getSymbols(Symbols[4],from=StartDate,auto.assign=FALSE))))
  S5&lt;-as.xts(dailyReturn(na.omit(getSymbols(Symbols[5],from=StartDate,auto.assign=FALSE))))
  S6&lt;-as.xts(dailyReturn(na.omit(getSymbols(Symbols[6],from=StartDate,auto.assign=FALSE))))
  S7&lt;-as.xts(dailyReturn(na.omit(getSymbols(Symbols[7],from=StartDate,auto.assign=FALSE))))
  S8&lt;-as.xts(dailyReturn(na.omit(getSymbols(Symbols[8],from=StartDate,auto.assign=FALSE))))
  S9&lt;-as.xts(dailyReturn(na.omit(getSymbols(Symbols[9],from=StartDate,auto.assign=FALSE))))
  S10&lt;-as.xts(dailyReturn(na.omit(getSymbols(Symbols[10],from=StartDate,auto.assign=FALSE)))) 
  ....
  S20&lt;-as.xts(dailyReturn(na.omit(getSymbols(Symbols[20],from=StartDate,auto.assign=FALSE)))) 
  
  SPportD&lt;-cbind(SP500,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,S16,S17,S18,S19,S20)
  names(SPportD)[1:(length(Symbols)+1)]&lt;-c("SP500",Symbols)
  
  SPportD.df&lt;-data.frame(index(SPportD),coredata(SPportD),stringsAsFactors=FALSE)
  names(SPportD.df)[1:(length(Symbols)+2)]&lt;-c(class(StartDate),"SP500",Symbols)
  </code></pre>
  
  <p>Any suggestions?</p>
  
  <p>Thanks!</p>