title: How to keep only groups above certain number of rows?
body: <pre><code>library(tidyverse)
  
  data&lt;-diamonds%&gt;%group_by(cut,color,clarity)%&gt;%
    summarize(aver=round(mean(price),0),count=n())%&gt;%
    filter(count&gt;10)%&gt;%
    mutate(rank1=min_rank(desc(aver)),rank2=cume_dist(desc(aver)))
  </code></pre>
  
  <p>So when you run this script you will get output below. Now in cut and color column there are just 3 combinations " Fair D" which is also possible to see from rank1 column. Another group " Fair E" has 5 rows. I want to keep just rows for groups with more than 3 rows .</p>
  
  <p><a href="https://i.stack.imgur.com/xx56B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xx56B.png" alt="enter image description here"></a></p>