title: converting an ftable to a matrix
body: <p>Take for example the following ftable</p>
  
  <pre><code>height &lt;- c(rep('short', 7), rep('tall', 3))
  girth &lt;- c(rep('narrow', 4), rep('wide', 6))
  measurement &lt;- rnorm(10)
  foo &lt;- data.frame(height=height, girth=girth, measurement=measurement)
  ftable.result &lt;- ftable(foo$height, foo$girth)
  </code></pre>
  
  <p>I'd like to convert the above <code>ftable.result</code> into a matrix with row names and column names.  Is there an efficient way of doing this?  <code>as.matrix()</code> doesn't exactly work, since it won't attach the row names and column names for you.</p>
  
  <p>You could do the following</p>
  
  <pre><code>ftable.matrix &lt;- ftable.result
  class(ftable.matrix) &lt;- 'matrix'
  
  rownames(ftable.matrix) &lt;- unlist(attr(ftable.result, 'row.vars'))
  colnames(ftable.matrix) &lt;- unlist(attr(ftable.result, 'col.vars'))
  </code></pre>
  
  <p>However, it seems a bit heavy-handed.   Is there a more efficient way of doing this?</p>