Error: evaluation nested too deeply: infinite recursion / options(expressions=)? in R on Mac
<pre><code>sum &lt;- function(data){
  sum(data)
}
median &lt;- function(data){
  median(data)
}
floor &lt;- function(data){
  floor(data)
} 
evaluate &lt;- function(func, dat){

  func(dat)
}
</code></pre>

<p>This is my code. The goal I want to achieve are as followings </p>

<ol>
<li><p>evaluate(sum, c(2, 4, 6)) should evaluate to 12;</p></li>
<li><p>evaluate(median, c(7, 40, 9)) should evaluate to 9;</p></li>
<li>evaluate(floor, 11.1) should evaluate to 11;</li>
</ol>

<p>But I always got the error as below</p>

<pre><code>Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
Error during wrapup: evaluation nested too deeply: infinite recursion / options(expressions=)?
</code></pre>