title: How do I summarise only part of a table?
body: <p>I have two related use-cases in which I need to summarise just parts of a table, specified in a way similar to <code>filter</code>.</p>
  
  <p>In a nutshell, I want something like this:</p>
  
  <pre><code>iris %&gt;%
      use_only(Species == 'setosa') %&gt;%
      summarise_each(funs(sum), -Species) %&gt;%
      mutate(Species = 'setosa_sum') %&gt;%
      use_all()
  </code></pre>
  
  <p>To yield this:</p>
  
  <pre><code>Source: local data frame [101 x 5]
  
     Sepal.Length Sepal.Width Petal.Length Petal.Width    Species
  1         250.3       171.4         73.1        12.3 setosa_sum
  2           7.0         3.2          4.7         1.4 versicolor
  3           6.4         3.2          4.5         1.5 versicolor
  4           6.9         3.1          4.9         1.5 versicolor
  5           5.5         2.3          4.0         1.3 versicolor
  …
  </code></pre>
  
  <p>So instead of grouping by the value of a column, I use a filtering criterion to operate on a view of the table, without <em>actually losing</em> the rest of the table (unlike filter).</p>
  
  <p><strong>How do I smartly implement <code>use_only</code>/<code>use_all</code>?</strong> Even better, is this functionality already contained in <code>dplyr</code> and how do I use it?</p>
  
  <p>It’s of course quite easy to generate the result above, but I need to do something similar for many different cases, with complex and variable criteria for filtering.</p>