title: How do I simplify and generalize this subset command in R?
body: <p>In an analysis script I have to do the following subset command a lot of times:</p>
  
  <pre><code>subset(df1, A == df2[1,'A'] &amp; V == df2[1,'B'] &amp; C == df2[1,'C'] &amp; D == df2[1,'D'])
  </code></pre>
  
  <p><strong>Is there a way in R to generalize this command?</strong> I would like to have something like</p>
  
  <pre><code>classifiers &lt;- c(
    'A',
    'B',
    'C',
    'D'
    )
  
  subset(df1, classifiers == df2[1,classifiers])
  </code></pre>