title: How to convert from category to numeric in r
body: <p>Here is my problem:<br></p>
  
  <p>I have a table with categories and I want to rank them:</p>
  
  <pre><code>category
  dog
  cat
  fish
  dog
  dog
  </code></pre>
  
  <p>What I want is to add a column and to rank them:</p>
  
  <pre><code>category       rank    
  dog             1  
  cat             2
  fish            3
  dog             1
  dog             1
  </code></pre>
  
  <ul>
  <li>Sorry for the terrible table (help in writing normal tables in stack overflow would be great, too)</li>
  <li>Any ideas about how to add the rank column?</li>
  </ul>
  
  <p>Thanks!</p>