title: R as.data.frame.matrix turns first column into row names
body: <p>I want to turn a table into a data frame. Three columns should be there: 1. the zip code 2 outcome "0" and 3 outcome "1". But as.data.frame.matrix turns the zip-code into row names and makes them unusable.</p>
  
  <p>I tried to add a fourth column with imaginary ID's (1:100) so R makes them to row names but R tells me, that "all arguments must be the same length" - which they are!</p>
  
  <pre><code>id &lt;- 1:5000
  zip &lt;- sample(100:200, 5000, replace = TRUE)
  outcome &lt;- rbinom(5000, 1, 0.23)
  df &lt;- data.frame(id, outcome, zip)
  
  abs &lt;- table(df$zip, df$outcome)
  abs &lt;- as.data.frame.matrix(abs)
  </code></pre>
  
  <p>Some has a nice and slick idea? Thanks in advance!</p>
  
  <p>Edit:</p>
  
  <p>When:</p>
  
  <pre><code>abs &lt;- as.matrix(as.data.frame(abs))
  </code></pre>
  
  <p>I get something close to what I want but the outcomes are together in one column. How to untie them, to make them look like the table again?</p>