title: Replace the argument with a list in R
body: <p>Some times there is a function which has an arbitrary number of arguments. For example, the <code>bootstrapPage</code> function of package shiny. If I have a data.frame and I want to create one widget for one row, then I have not figured out a pretty way to pass the number of arguments according to the row number of the data.frame. So far, I generate the script and use the trick of <code>eval(parse(text="..."))</code></p>
  
  <p>In fact, the structure of arguments passed to function in R (key and value) is similar to a <code>list</code>, so I am wondering if there is a way to pass the argument as a list in R.</p>
  
  <p>More specifically, if I have a function <code>f</code> and a list <code>argv</code>, is there a way to pass the objects in <code>argv</code> to <code>f</code> according to the matching of the name of <code>argv</code> and the name of the arguments of <code>f</code>, and the position in <code>argv</code> and the position in the arguments of <code>f</code>?</p>
  
  <p>For example, let</p>
  
  <pre><code>f &lt;- function(a, b) a + b
  argv &lt;- list(a=1, b=2)
  </code></pre>
  
  <p>How should I pass the <code>argv</code> to <code>f</code> which is equivalent to <code>f(a=argv$a, b=argv$b)</code>? </p>
  
  <p>Or if we have:</p>
  
  <pre><code>f &lt;- function(a, b, ...) { # some codes }
  argv &lt;- list(a = 1, b = 2, 3, 4, 5)
  </code></pre>
  
  <p>How should I pass the <code>argv</code> to <code>f</code> which is equivalent to <code>f(a=argv$a, b=argv$b, argv[[3]], argv[[4]], argv[[5]])</code>?</p>
  
  <p>Thanks!</p>