title: Passing arguments in R within functions, error unused arguments
body: <p>Consider the first function:</p>
  
  <pre><code>fruits &lt;- function(apples, oranges){
     apples + oranges
  }
  
  #example#
  &gt; fruits(2,3) 
  [1] 5
  </code></pre>
  
  <p>The second function uses the first function <code>fruits</code>:</p>
  
  <pre><code>fruitsandvegetables &lt;- function(tomatoes){
     fruits(apples, oranges) + tomatoes
  }
  </code></pre>
  
  <p>Now consider the following errors:</p>
  
  <pre><code>&gt; fruitsandvegetables(3)
    Error in fruits(apples, oranges) : object 'apples' not found
  &gt; fruitsandvegetables(3, apples = 2, oranges = 3)
    Error in fruitsandvegetables(3, apples = 2, oranges = 3) : 
    unused arguments (apples = 2, oranges = 3)
  &gt; fruitsandvegetables(tomatoes = 3, apples = 2, oranges = 3)
    Error in fruitsandvegetables(tomatoes = 3, apples = 2, oranges = 3) : 
    unused arguments (apples = 2, oranges = 3)
  </code></pre>
  
  <p>I understand these errors, but I was wondering if there is a simple way to get around this. For more complex function with many arguments, rewriting the functions can be very tedious.</p>
  
  <p>In otherwords I would like the function to behave this way:</p>
  
  <pre><code>fruitsandvegetables(3, apples = 2, oranges =3)
  [8]
  </code></pre>