title: filtering data.frame based on row_number()
body: <p><strong>UPDATE: dplyr has been updated since this question was asked and now performs as the OP wanted</strong></p>
  
  <p>I´m trying to get the second to the seventh line in a <code>data.frame</code> using <code>dplyr</code>.</p>
  
  <p>I´m doing this:</p>
  
  <pre><code>require(dplyr)
  df &lt;- data.frame(id = 1:10, var = runif(10))
  df &lt;- df %&gt;% filter(row_number() &lt;= 7, row_number() &gt;= 2)
  </code></pre>
  
  <p>But this throws an error. </p>
  
  <pre><code>Error in rank(x, ties.method = "first") : 
    argument "x" is missing, with no default
  </code></pre>
  
  <p>I know i could easily make:</p>
  
  <pre><code>df &lt;- df %&gt;% mutate(rn = row_number()) %&gt;% filter(rn &lt;= 7, rn &gt;= 2)
  </code></pre>
  
  <p>But I would like to understand why my first try is not working.</p>