title: Convert row names in multiple data frames to column in data frame
body: <p>I have a list of <code>.csv</code> files that I have read in to R and placed in a large data frame called <code>data</code> that consists of 6 data.frames which are the 6 files in <code>filenames</code>. My code so far is:    </p>
  
  <pre><code>filenames &lt;- list.files( paste(mainDirInput,sep=""), pattern="Out.*csv", full.names=TRUE) 
  data = lapply(filenames, function(f) {
  wb = read.csv(f, header=TRUE)
  })
  </code></pre>
  
  <p>The row names and column names in each data.frame are exactly the same, I would like to extract the row names and instead have them as the first column in R. An example of one of my data frames would be like this:</p>
  
  <pre><code>            w    x    y    z
  2012 01     12   43   87   09
  2012 02     14   53   75   76
  2012 03     76   34   76   28
  2012 04     41   36   85   16
    :         :    :    :    :
    :         :    :    :    :
  </code></pre>
  
  <p>I need to be able to use this code on other files as well, so I can't simply just create a new column with the values <code>2012 01, 2012 02, 2012 03...</code> </p>