title: Convert a data frame column into a frequency distribution in R
body: <p>I have recently started to work on some statistical problems in R and I have a query. I normally code in python and find the "collections.Counter" function quite useful. However I did not find any such equivalent command in R which was surprising since frequencies are used a lot in statistics. </p>
  
  <p>for e.g. I have this table (data frame) -</p>
  
  <pre><code>df -&gt;
  
  c1          c2
  reading1    2
  reading2    3
  reading3    1
  reading4    3
  reading5    2
  reading6    4
  reading7    1
  reading8    2
  reading9    4
  reading10   5 
  </code></pre>
  
  <p>and I want to get this in R- </p>
  
  <pre><code>value    frequency
      1    2
      2    3
      3    2
      4    2
      5    1
  </code></pre>
  
  <p>I hope this illustrates what I would like to do..
  Any help is appreciated</p>
  
  <p>and for illustration purposes - In python I could do this - </p>
  
  <pre><code>df_c2 = [2,3,1,3,2,4,1,2,4,5]
  counter=collections.Counter(df$c2)
  print (counter)
  
  and get this - Counter({2: 3, 1: 2, 3: 2, 4: 2, 5: 1})
  which I can manipulate using loops.
  </code></pre>