title: How to summarize data by several groups (R)
body: <p>I have a dataframe that looks like this:</p>
  <p><a href="https://i.stack.imgur.com/6snn0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6snn0.png" alt="enter image description here" /></a></p>
  <p>And I want to get this, that is, a single row per Group, with a column for the % of As in all the ID_1_Subgroup for each Group, together with the sum of ValueSubgroup, for each group too):</p>
  <p><a href="https://i.stack.imgur.com/n5lSg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n5lSg.png" alt="enter image description here" /></a></p>
  <p>Can someone help? I have seen other issues (like this: <a href="https://stackoverflow.com/questions/7987228/summarizing-by-group-and-subgroup">Summarizing by group and subgroup</a>) which are similar but not for R.</p>