title: Subset dataframe in R using multiple inequality expressions
body: <h1>Problem</h1>
  
  <p>This question is an extension on the topic of subsetting using multiple logical conditions—particularly strict inequalities—to subset a data frame in R (see <a href="https://stackoverflow.com/questions/4935479/how-to-combine-multiple-conditions-to-subset-a-data-frame-using-or">here</a> and <a href="https://stackoverflow.com/questions/9860090/why-is-better-than-subset?noredirect=1&amp;lq=1">here</a>).</p>
  
  <p>Say my variable ranges from 0 to 100. I need to create a subset that returns values that are between 50 and 100, but also values less than 25.</p>
  
  <pre><code># Data
  df$var = seq(1:100)
  
  # Desired Subset
  df$var[df$var &gt; 50 &amp; df$var &lt; 100 &amp; df$var &lt; 25]
  </code></pre>
  
  <h1>Question</h1>
  
  <ul>
  <li>What is the best way to make a subset involving multiple inequalities using base R?</li>
  <li>Are solutions using non-base R packages more elegant?</li>
  </ul>