title: subsetting data using multiple variables in R
body: <p>I have a data set, DATA, with many variables. DATA has a list mode and its class is a data.frame.
  The variables I'm concerned with are AGE.MONTHS and LOCATION. I need to subset DATA into another set called SUB, and I want SUB to only contain the observations where AGE.MONTHS &lt;= 2 and LOCATION = "Area A". AGE.MONTHS is has a numeric mode and class. LOCATION has a numeric mode and its class is a factor. I have tried the following,</p>
  
  <pre><code>SUB&lt;-which((DATA$AGE.MONTHS &lt;= 2 )&amp; (DATA$LOCATION=="Area A"))
  </code></pre>
  
  <p>But this only tells me which observations these conditions hold true for, and what I need is a subset of all the data for which these conditions hold.
  Thanks for your help.</p>