title: How to ungroup a merged table in R?
body: <p>I have this table that I made by joining two other tables created with CPS data. I joined the two by <code>age</code> and <code>sex</code> and then I calculated the labor force participation rate for each age and sex in this hypothetical economy.  Now I need to collapse the table by <code>age</code> and <code>sex</code> so that I can get the total population labor force participation rate, but for some reason the <code>ungroup()</code> command just isn't working. I've included an excerpt of the data in the attached image link and the code I have so far. </p>
  
  <pre><code>cps_summary2 &lt;- left_join(cps_summary2015, cps_summary1995,
                       by = c("age", "sex"))
  cps_summary2 &lt;- cps_summary2 %&gt;% mutate(estWorkingAgePop = cps_summary2$total_pop.x * cps_summary2$lfpr.y)
  cps_summary2 &lt;- cps_summary2 %&gt;% mutate(laborforcerate = estWorkingAgePop/total_pop.y)  %&gt;% 
  ungroup(cps_summary2, by = c("age", "sex"))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/B7jUx.png" alt="Data Excerpt"></p>