title: Converting (cross) table into list view
body: <p>In the past I asked a question about how to <a href="https://stackoverflow.com/questions/13451394/how-to-make-a-cross-table-with-na-instead-of-x">create cross tables from a list view</a>. I was recommended to use <code>xtabs</code> for this, which works great. Today, I have been searching to do the reverse and create a list view table from a cross table. I was hoping to find a reverse formula, but haven't been successful. I am confident that there is a predefined function for this, but can't figure out to find it. </p>
  
  <p>I have the following table: </p>
  
  <pre><code># load table     
  crosstable &lt;- structure(list(col1 = c(0, 0, 1, 0, 0, 0, 0, 0, 0), col2 = c(0, 1, 0, 0, 0, 0, 0, 0, 0), col3 = c(0, 0, 0, 0, 0, 0, 0, 0, 1), col4 = c(1, 0, 0, 0, 0, 0, 0, 0, 0), col5 = c(0, 0, 0, 0, 0, 0, 0, 1, 0), col6 = c(0, 0, 0, 0, 0, 1, 0, 0, 0), col7 = c(0, 0, 0, 0, 1, 0, 0, 0, 0), col8 = c(0, 0, 0, 0, 0, 0, 1, 0, 0)), .Names = c("col1", "col2", "col3", "col4", "col5", "col6", "col7", "col8"), row.names = c("row1", "row2", "row3", "row4", "row5", "row6", "row7", "row8", "row9"), class = "data.frame")
  
  #display table
  crosstable
  
       col1 col2 col3 col4 col5 col6 col7 col8
  row1    0    0    0    1    0    0    0    0
  row2    0    1    0    0    0    0    0    0
  row3    1    0    0    0    0    0    0    0
  row4    0    0    0    0    0    0    0    0
  row5    0    0    0    0    0    0    1    0
  row6    0    0    0    0    0    1    0    0
  row7    0    0    0    0    0    0    0    1
  row8    0    0    0    0    1    0    0    0
  row9    0    0    1    0    0    0    0    0
  </code></pre>
  
  <p>I would like to convert this into a table that shows something like the following:</p>
  
  <pre><code>row1 col1 0
  row1 col2 0
  row1 col3 0
  row1 col4 1
  row1 col5 0
  ...
  </code></pre>
  
  <p>Anybody able to point me in the direction of the function that will help to accomplish this? </p>