title: How to download intraday stock market data with R
body: <p>All, </p>
  
  <p>I'm looking to download stock data either from Yahoo or Google on 15 - 60 minute intervals for as much history as I can get. I've come up with a crude solution as follows: </p>
  
  <pre><code>library(RCurl)
  tmp &lt;- getURL('https://www.google.com/finance/getprices?i=900&amp;p=1000d&amp;f=d,o,h,l,c,v&amp;df=cpct&amp;q=AAPL')
  tmp &lt;- strsplit(tmp,'\n')
  tmp &lt;- tmp[[1]]
  tmp &lt;- tmp[-c(1:8)]
  tmp &lt;- strsplit(tmp,',')
  tmp &lt;- do.call('rbind',tmp)
  tmp &lt;- apply(tmp,2,as.numeric)
  tmp &lt;- tmp[-apply(tmp,1,function(x) any(is.na(x))),]
  </code></pre>
  
  <p>Given the amount of data I'm looking to import, I worry that this could be computationally expensive. I also don't for the life of me, understand how the time stamps are coded in Yahoo and Google. </p>
  
  <p>So my question is twofold--what's a simple, elegant way to quickly ingest data for a series of stocks into R, and how do I interpret the time stamping on the Google/Yahoo files that I would be using? </p>