title: Stepping through a pipeline with intermediate results
body: <p>Is there a way to output the result of a pipeline at each step without doing it manually? (eg. without selecting and running only the selected chunks)</p>
  
  <p><strong>I often find myself running a pipeline line-by-line to remember what it was doing or when I am developing some analysis.</strong></p>
  
  <p>For example:</p>
  
  <pre><code>library(dplyr)
  
  mtcars %&gt;% 
    group_by(cyl) %&gt;% 
    sample_frac(0.1) %&gt;% 
    summarise(res = mean(mpg))
  # Source: local data frame [3 x 2]
  # 
  # cyl  res
  # 1   4 33.9
  # 2   6 18.1
  # 3   8 18.7
  </code></pre>
  
  <p>I'd to select and run:</p>
  
  <pre><code>mtcars %&gt;% group_by(cyl)
  </code></pre>
  
  <p>and then...</p>
  
  <pre><code>mtcars %&gt;% group_by(cyl) %&gt;% sample_frac(0.1)
  </code></pre>
  
  <p>and so on...</p>
  
  <p>But selecting and <code>CMD/CTRL</code>+<code>ENTER</code> in <code>RStudio</code> leaves a more efficient method to be desired.</p>
  
  <p>Can this be done in code? </p>
  
  <p><strong>Is there a function which takes a pipeline and runs/digests it line by line showing output at each step in the console and you continue by pressing enter like in <code>demos(...)</code> or <code>examples(...)</code> of package guides</strong></p>