title: Creating Mutate Columns based on individual filters
body: <p>I have a tbl_df that I'm trying to create unique columns based on a variety of filters.   I did some reading on using ifelse, and other mutate functions but wasn't able to figure this one out on my own.  The df is named Test and is listed below.  </p>
  
  <pre><code>name   team salary season position
  &lt;chr&gt; &lt;int&gt;  &lt;int&gt;  &lt;int&gt; &lt;chr&gt;   
  AP        6     15   2017 OF      
  AN       11      8   2016 SP      
  AS        1      8   2014 SP      
  AR        3     11   2018 SS      
  AB        2     10   2015 3B      
  AC        8      7   2017 RP      
  Abe      11     10   2016 OF      
  AM        7     12   2014 RP      
  Ari      11     48   2018 1B      
  BH       13     29   2015 OF           
  </code></pre>
  
  <p>I'm trying to create a variety of columns based on the results of specific filters.  The code I have so far is as follows:</p>
  
  <pre><code>summary &lt;- test %&gt;%
    group_by(team, season)
  </code></pre>
  
  <p>The mutate columns I'm trying to create are:</p>
  
  <ol>
  <li>Hitting: Sum all values from Salary for rows with a position that does not equal SP or RP, and seasons 2016-2018</li>
  <li>Pitching: Sum all values from Salary for rows with a position that  equals SP or RP, and seasons 2016-2018</li>
  <li>Relievers: Count all rows with a position equal to RP</li>
  <li>Over_40: Count all rows with a salary over 40</li>
  <li>Over_40_H: Count all rows with a salary over 40 and position not equal to SP or RP</li>
  </ol>
  
  <p>I want all of these columns and results to be grouped by team, and season (as shown above)</p>