title: dplyr: use chaining to pass variables
body: <p>I'm new to <code>dplyr</code> and cannot figure out how to control the variables to pass through a chaining (<code>%&gt;%</code>) command. Simple example: the <code>str_sub</code> function takes three arguments - the first is passed on through <code>%&gt;%</code> but how can I get the last two? :</p>
  
  <pre><code>library(stringr)
  library(dplyr)
  df &lt;- data.frame(V1 = c("ABBEDHH", "DEFGH", "EFGF", "EEFD"), 
                   V2=c(4, 2, 1, 1), V3=c(5, 2, 2, 1), stringsAsFactors=FALSE)
  </code></pre>
  
  <p>In base R I could do:</p>
  
  <pre><code>with(df, str_sub(V1, V2, V3))
  </code></pre>
  
  <p>and get: </p>
  
  <pre><code>## [1] "ED" "E"  "EF" "E" 
  </code></pre>
  
  <p>How to chain this ? - I tried:</p>
  
  <pre><code>df %&gt;% str_sub(V1, V2, V3) # Here V3 is unused arg since V1 is treated as 2nd arg
  
  df %&gt;% select(V1) %&gt;% str_sub(V2, V3) # Here V2 and V3 are not recognized
  </code></pre>