title: R - tidyverse - mutate function to reduce a dataframe length
body: <p>I learn R and the tidyverse and I can not find an answer to my question because I lack the proper vocabulary to describe what I want to achieve.</p>
  <p>I have a large dataset with that structure :
  <code>df &lt;- tibble(x = c(&quot;species1&quot;, &quot;species2&quot;, &quot;species1&quot;, &quot;species3&quot;), y = 1:4)</code></p>
  <p>and I need to &quot;compress&quot; it into that modified dataframe by adding the observations for each unique species</p>
  <p><code>df_modif &lt;- tibble(x = c(&quot;species1&quot;, &quot;species2&quot;, &quot;species3&quot;), y = c(4,2,4))</code></p>
  <p>Could someone help me by explaining if there is a way to achieve this, please? And is there a word to describe that &quot;compression&quot; of a dataframe?</p>
  <p>Have a nice day</p>