title: How does dplyr’s between work?
body: <p>I’ve read the documentation and I’ve tried googling it; it should be a simple thing, but it would seem it’s not to me; so I boldly go forth and ask if someone here could explain me how dplyr’s <code>between()</code> works.</p>
  
  <pre><code># Explanation documentation
  between(x, left, right)
  
  x            A numeric vector of values
  left, right: Boundary values
  </code></pre>
  
  <p>I understand a vector is a one-dimensional array, so I suppose <code>c(1:7)</code> is a vector, right? I tried using the example provided in the documentation as a template to search for flights july–september, but the following just returns an error:</p>
  
  <pre><code># Example from documentation cont’d
  x &lt;- rnorm(1e2)
  x[between(x, -1, 1)]
  
  # Loading the library
  library(nycflights13)
  
  # Execute my hopeless attempt at between()
  flights[between(month, 7, 9)]
  
  # Output and error message
  &gt; flights[between(month, 7, 9)]
  Error in between(month, 7, 9) : object 'month' not found
  </code></pre>
  
  <p>I feel really daft asking this, but any help in understanding this will be greatly appreciated. I would also apologise for not asking a well-defined question; as is probably appreciated, I really don’t know how to phrase it other than ‘I don’t get it’.</p>