title: How do I get all S&P500 corp code list using R?
body: <p>I want to make FOR statement in R for analysis Stock data at one go. </p>
  
  <p>But I don't know how do I get a S&amp;P corp code list. </p>
  
  <p>Please, let me know solution. </p>
  
  <p>Thank you.</p>
  
  <pre><code>library(rpart)
  library(rpart.plot)
  library("quantmod")
  startDate = as.Date("2012-01-01")
  endDate = as.Date("2014-01-01") 
  getSymbols("005930", src = "google", from = startDate, to = endDate) 
  </code></pre>