title: Collapse Factors when their count is less than 25: ForCats R
body: <p>I have a <code>Race</code> factor that has 34 levels. Since the counts in many levels are less than 20, I want to collapse them into a single category - &quot;Other&quot;. Note that I already have <code>&quot;Other&quot;</code> as one level.</p>
  <p>I see the documentation for <code>fct_collapse()</code> as you specifying the levels you want to collapse into one but not sure how to implement <code>count() &lt; 20</code> in this. Perhaps a <code>case_when</code> but I'm not sure how.</p>