title: How to add table headers in r
body: <p>I've made this table, but I want to add headers to my table which show the categories I'm comparing. At this point I've got this:</p>
  <pre><code>n &lt;- c('like', 'must-be','neutral','live-with','dislike')
  
  t &lt;- table(factor(d$s1q4, levels = 1:5),factor(d$s1q1, levels = 1:5))
  colnames(t) &lt;- n
  rownames(t) &lt;- n
  t
  </code></pre>
  <p>but now I want to add a name for <code>d$s1q4</code> and <code>d$s1q1</code> and make it show up in the table.</p>