title: R: how to pass functions as arguments to another function
body: <p>Suppose I want to integrate some function that involves sums and products of a few other user defined functions. Lets take an extremely simple example, it gives the same error.</p>
  
  <pre><code>integrate(f = sin + cos, lower=0, upper=1)
  </code></pre>
  
  <p>This yields "Error in sin + cos : non-numeric argument to binary operator" which I think is saying it doesn't make sense to just add functions together without passing them some sort of argument. So I am a bit stuck here. <a href="https://stackoverflow.com/questions/7426730/how-can-i-find-the-sum-of-a-list-of-functions-in-r/7428012#7428012">This thread</a> poses what I think is a solution to a more complicated question, that can be applied here, but it seems long for such a simple task in this case. I'm actually kind of surprised that I am unable to find passing function arguments to functions in the help manual so I think I am not using the right terminology.</p>