Ungroup after grouping by just one variable in dplyr : <p>I have a lot of units that are measured repeated times </p>

<pre><code>&gt;df
Item value  year
1     20     1990
1     20     1991
2     30     1990
2     15     1990
2     5      1991
3     10     1991
4     15     1990
5     10     1991
5      5     1991
</code></pre>

<p>I am trying to use dplyr to remove values that have a low number of observations. On this toy data lets say that I want to remove data which has fewer than 2 counts</p>

<pre><code>&gt;df &lt;- df %&gt;% 
  group_by(Item) %&gt;% 
  tally() %&gt;% 
  filter(n&gt;1)

Item  n
1     2
2     3
5     2
</code></pre>

<p>The problem is that I would like to expand this back to what it was, but with this filter. I attempted using the <code>ungroup</code> command, but that seems to only have an effect when grouping by two variables. How can I filter by item counts then get my original variables back i.e <code>value</code> and <code>year</code>. It should look like this</p>

<pre><code>&gt;df
Item value  year
1     20     1990
1     20     1991
2     30     1990
2     15     1990
2     5      1991
5     10     1991
5      5     1991
</code></pre>
