title: Sum different values from categorical data?
body: <p>I have a df with this structure:</p>
  <pre><code>state sex population deaths   year
  
  CAL    F    5           3      1980
  CAL    M    4           1      1980
  TX     F    10          6      2001
  TX     M    16          5      2001
  </code></pre>
  <p>I would like to sum the female (F) population and Male (M) population and deaths and have a row like this:</p>
  <pre><code>state sex population deaths year  
  
  CAL    F    5           3   1980
  CAL    M    4           1   1980
  CAL    T     9          4   1980 
  TX     F    10          6   2001 
  TX     M    16          5   2001
  TX     T    26          11  2001
  </code></pre>
  <p>Where T is the sum of female and Male Data</p>