[R] detecting entry into a recursive function
jim at bitwrit.com.au
Mon Feb 18 02:51:25 CET 2013
On 02/18/2013 02:03 AM, Benjamin Tyner wrote:
> Thanks Jim -- I had considered this approach; is there any way to "hide"
> such arguments from users?
I played around with your solution for a while and if the first argument
to the function changes with each recursive call, you may be able to do
it like this:
if(as.character(x) == as.character(sys.call()))
cat("I\'m the first!\n")
More information about the R-help