title: Better Way To Plot OHLC Minute Data From Imported csv in R
body: <p>It took me quite a bit of time to get this to work, but I have plotted an OHLC chart for 1 minute timeframes for AAPL on 2/28/14 using the below function.  The csv file can be downloaded here, <a href="https://drive.google.com/file/d/0B4xAKSwsHiEBRGlyMEE3V0ROckU/edit?usp=sharing" rel="nofollow">https://drive.google.com/file/d/0B4xAKSwsHiEBRGlyMEE3V0ROckU/edit?usp=sharing</a></p>
  
  <pre><code>PlotAAPLData &lt;- function()
  {
  
    library(zoo)
    library(quantmod)
  
    z &lt;- read.csv("AAPL 1 min 2-28-14.csv", stringsAsFactors = F)
    z &lt;- read.zoo(z, header = TRUE, index = 1:2, tz = "", format = "%m/%d/%y %H:%M")
    z$Volume &lt;- 0
    z$Adjusted &lt;- 0
    z &lt;- as.quantmod.OHLC(z)
    chartSeries(z, type = "bars", theme = chartTheme("white"))
  }
  </code></pre>
  
  <p>I had to coerce the data to work with quantmod, however, I don't need any of the functionality that quantmod offers, other than to plot the OHLC, so converting it into that format is not really necessary.</p>
  
  <p>Ia there a better way to do this?  The most challenging part was getting the data into zoo format as the dates have to be just so.  Looking at it now, it doesn't seem so complicated but it was a while in coming.</p>
  
  <p>Thanks.</p>