title: ggplot: plot frequency counts of values in a dataframe (with no preprocessing)
body: <p>I often find myself doing this:</p>
  
  <pre><code># Original data
  df.test &lt;- data.frame(value=floor(rexp(10000, 1/2)))
  
  # Compute the frequency of every value
  # or the probability
  freqs &lt;- tabulate(df.test$value)
  probs &lt;- freqs / sum(freqs)
  
  # Create a new dataframe with the frequencies (or probabilities)
  df.freqs &lt;- data.frame(n=1:length(freqs), freq=freqs, probs=probs) 
  
  # Plot them, usually in log-log
  g &lt;- ggplot(df.freqs, aes(x=n, y = freq)) + geom_point() + 
    scale_y_log10() + scale_x_log10()
  plot(g)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/OWHhl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OWHhl.png" alt="enter image description here"></a></p>
  
  <p>Can it be done just using <code>ggplot</code> without creating an intermediate dataset?</p>