title: Group by, pivot, count and sum in DF in R
body: <p>I have a date frame with the fields PARTIDA (date), Operação (4 levels factor) and TT (numeric) .</p>
  
  <p><a href="https://i.stack.imgur.com/rdLIn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rdLIn.png" alt="nenter image description here"></a></p>
  
  <p>I need to group by the PARTIDA column, pivot the Operation column counting to the frequency of each level and sum the TT column.
  Like this:</p>
  
  <p><a href="https://i.stack.imgur.com/t0lAt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t0lAt.png" alt="enter image description here"></a></p>
  
  <p>I already tried something with dplyr but I could not get this result, can anyone help me?</p>