title: How to get the top n elements (in terms of frequency) from a vector in R?
body: <p>How can I get the top n ranking of an array in R?</p>
  
  <p>lets say I have</p>
  
  <p><code>a &lt;- c(67, 2, 100, 2, 100, 23, 2, 100, 67, 89,100)</code></p>
  
  <p>how can I get:</p>
  
  <pre><code>rank   number   times
  1     100       4
  2     2         3
  3     67        2
  4     23        1
  4     89        1
  </code></pre>