title: How can I count the number of times a value occurs in a column of a dataframe?
body: <p>Is there a simple way of identifying the number of times a value is in a vector or column of dataframe? I essentially want the numerical values of a histogram but I do not know how to access it.</p>
  
  <pre><code># sample vector
  a &lt;- c(1,2,1,1,1,3,1,2,3,3)
  
  #hist
  hist(a)
  </code></pre>
  
  <p>Thank you.</p>
  
  <p><em>UPDATE:</em></p>
  
  <p>On Dirk's suggestion I am using hist. Is there a better way than than specifying the range as 1.9, 2.9 etc when I know that all my values are integers?</p>
  
  <pre><code> hist(a, breaks=c(1,1.9,2.9,3.9,4.9,5.9,6.9,7.9,8.9,9.9), plot=FALSE)$counts
  </code></pre>