title: Renaming rows and columns in R
body: <p>I'm running the following script: </p>
  
  <pre><code>cause = c(1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2); 
  time =  c(1, 1, 2, 3, 3, 2, 2, 1, 1, 2, 2); 
  table(cause, time)
  </code></pre>
  
  <p>And I get the following:</p>
  
  <pre><code>    time
  cause 1 2 3
      1 2 2 2
      2 2 3 0
  </code></pre>
  
  <p>What I want is this:</p>
  
  <pre><code>      time
  cause     1 2 3
  Maltreat  2 2 2
  Non-Maltr 2 3 0
  </code></pre>
  
  <p>So, my question is: how do you rename the rows of a table in R?</p>
  
  <p>In the same vein, how would you rename the columns of that table?</p>