title: Using group_by function from dplyr, is there a way to group ranges of a single variable?
body: <p>I am looking at NBA statistics, particularly Points Scored Per Game and Salary. Currently summarizing them in R using <code>dplyr</code>'s group_by function. I am trying to group the PPG to look at salaries scored by players who have scored a specific range of Points per game. At the moment it just lists every single PPG value from my data, is there a way to turn it into a range. For example from 0-10 PPG, 10-20 PPG, 20-30 PPG and 30+.</p>
  
  <p>Here is the line of code I have at the moment:</p>
  
  <pre><code>cps3 &lt;- cps1 %&gt;% group_by(PPG) %&gt;%
         summarize(Mean_Salary = mean(Salary),
                   Min_Salary = min(Salary),
                   Max_Salary = max(Salary),
                   Number_of_Salaries = n())
  </code></pre>
  
  <p><code>cps1</code> is just my data set.</p>