title: R - Generating dynamic text for Select Argument in Subset Function
body: <p>I'm having a problem with using subset() inside a function I'm writing. </p>
  
  <pre><code>myFun &lt;- function(arg1="", arg2="", arg3="")
  
  {
      temp.frame &lt;- subset(master.frame, a == arg1 &amp; b == arg2 &amp; c == arg3)
  
  }
  </code></pre>
  
  <p>This works fine if specifies all arguments, but if any one or more of the arguments isn't specified subset function doesn't work properly (as it look for missing values in column vector passed with null values in function calling) </p>
  
  <p>I want it to work such that if an argument is not specified, it is not included in what subset() goes looking for.  </p>
  
  <p>So if I were to input:</p>
  
  <pre><code>function1(arg2=5, arg3=6)  then in function1, the subset command will look like
  temp.frame &lt;- subset(master.frame, b == 5 &amp; c == 6)
  </code></pre>
  
  <p>Any suggestions?</p>