title: How to plot the rownames as dates in a plot?
body: <p>I am using the sp500ret data from rugarch package:</p>
  
  <pre><code>library(rugarch)
  data(sp500ret)
  </code></pre>
  
  <p>This is (at least I think so) a dataframe, which gives the returns. The rownames are the dates. Now, I want to plot the returns and the dates, so</p>
  
  <pre><code>plot(dates,sp500ret)
  </code></pre>
  
  <p>but of course, this does not work, since dates is not specified, but how can I use the rownames as the corresponding dates?</p>
  
  <p>Note: I am not sure about this, but I read something about a xts file. Is this a xts file and how can I plot it in this case?</p>
  
  <p>edit:
  I thought about something like this, but it does not work:</p>
  
  <pre><code>plot(as.Date(rownames(sp500ret), "%Y%m%d"),sp500ret)
  </code></pre>
  
  <p>2nd edit:
  also <code>plot(rownames(sp500ret),sp500ret[,1])</code> does not work.</p>