title: R - how to split into terciles during group_by
body: <p>Let's say we want to calculate the means of sepal length based on tercile groups of sepal width.</p>
  
  <p>We can use the <code>split_quantile</code> function from the <code>fabricatr</code> package and do the following:</p>
  
  <pre><code>iris %&gt;% 
      group_by(split_quantile(Sepal.Width, 3)) %&gt;% 
      summarise(Sepal.Length = mean(Sepal.Length))
  </code></pre>
  
  <p>So far so good. Now, let's say we want to <code>group_by(Species, split_quantile(Sepal.Width, 3))</code> instead of just <code>group_by(split_quantile(Sepal.Width, 3))</code>. </p>
  
  <p>However, what if we want the terciles to be calculated <strong><em>inside</em></strong> of the each species type and not generally?</p>
  
  <p>Basically, what I'm looking for could be achieved by splitting <code>iris</code> into several dataframes based on <code>Species</code>, using <code>split_quantile</code> on those dataframes to calculate terciles and then joining the dataframes back together. However, I'm looking for a way to do this <strong><em>without</em></strong> splitting the dataframe.</p>