title: Counting number of factors that occur in a data frame then only deleting that row if the number of factors is less than or equal to x
body: <p>I have a data frame where the <code>$type</code> variable is factor.</p>
  
  <p><code>df &lt;- data.frame(type=c('a', 'a', 'b', 'c', 'b', 'b', 'c', 'a', 'd'), state=c('Washington','Washington','Washington','Washington','Washington','Washington','Washington','Washington','Washington'))</code></p>
  
  <p>Goal: <code>a</code> and <code>b</code> appear 3 or more times, but <code>c</code> and <code>d</code> only appears twice and once. I want to delete the rows where df$type has <code>c</code> and <code>d</code> so new df should look like this:</p>
  
  <p><code>df &lt;- data.frame(type=c('a', 'a', 'b', 'b', 'b', 'a'),
  state=c('Washington','Washington','Washington','Washington','Washington','Washington'))</code></p>