Filter with a condition : <pre><code>df &lt;- data.frame(month_key = c(rep(201504, 2), rep(201505, 3)),
                 id = c(1, 2, 1, 2, 3))
</code></pre>

<p>I have a dataframe like df, for each month ID are not necessary distinct.
I want to filter my dataframe and keep only the ID with appears in the first month_key (in my exemple id = 1 and 2).
I don't want to select my id for the first month and inner_join with the other month ...
Thank you</p>
