title: How to keep count in a recursive function in R?
body: <p>I have a recursive function in R. I would like to track it and know how many times the function is called during the procedure. How can I do it in R?</p>
  
  <p>EDIT: sample code:</p>
  
  <pre><code>test &lt;- function(num)
  {
    if(num&gt;100)
      return(num)
    num &lt;- num+4
    res &lt;- test(num)
    return(res)
  }
  </code></pre>