title: Plotting in ggplot after converting to data.frame with a single column?
body: <p>I'm trying to convert some simple data into a form I thought ggplot2 would accept. </p>
  
  <p>I snag some simple stock data and now I just want to plot, later I want to plot say a 10-day moving average or a 30-day historical volatility period to go with it, which is I'm using ggplot. </p>
  
  <p>I thought it would work something like this line of pseudocode</p>
  
  <p>ggplot(maindata)+geom_line(moving average)+geom_line(30dayvol)</p>
  
  <pre><code>library(quantmod)
  library(ggplot2)
  start = as.Date("2008-01-01")
  end = as.Date("2019-02-13")
  start
  tickers = c("AMD")
  getSymbols(tickers, src = 'yahoo', from = start, to = end)
  
  closing_prices = as.data.frame(AMD$AMD.Close)
  
  ggplot(closing_prices, aes(y='AMD.Close'))
  </code></pre>
  
  <p>But I can't even get this to work. The problem of course appears to be that I don't have an x-axis. How do I tell ggplot to use the index column as a. Can this not work? Do I have to create a new "date" or "day" column? </p>
  
  <p>This line for instance using the Regular R plot function works just fine</p>
  
  <pre><code>plot.ts(closing_prices) 
  </code></pre>
  
  <p>This works without requiring me to enter a hard x-axis, and produces a graph, however I haven't figured out how to layer other lines onto this same graph, evidently ggplot is better so I tried that. </p>
  
  <p>Any advice?</p>