title: How do I create a table of value-frequency combinations arranged vertically in R
body: <p>How do I create a table of value-frequency combinations arranged vertically, </p>
  
  <pre><code>&gt; df = data.frame(fruit=c("apple", "banana", "cherry", "cherry", "apple", "banana", "apple", "date"));
  &gt; table(df$fruit)
  
   apple banana cherry   date 
       3      2      2      1
  </code></pre>
  
  <p>So far so good. But I'd like something that's like this (e.g. to basic manipulations and subsetting of values based on the frequency):</p>
  
  <pre><code>Fruit   Freq
  "apple"   3
  "banana"  2
  "cherry"  2
  "date"    1
  </code></pre>
  
  <p>In SQL, that'd be <code>SELECT fruit, COUNT(*) AS Freq FROM df GROUP BY fruit</code>, and would yield  a table that's like the starting point to this question:   <a href="https://stats.stackexchange.com/questions/15574/how-to-convert-a-frequency-table-into-a-vector-of-values">https://stats.stackexchange.com/questions/15574/how-to-convert-a-frequency-table-into-a-vector-of-values</a> </p>
  
  <p>Is there an easy way to do that in <strong>R</strong>? (Alternatively, does this indicate a mindset that's too 'SQL' and not enough 'R'?) </p>