[R] get the enclosing function name

Hao Cen hcen at andrew.cmu.edu
Fri Dec 11 14:50:38 CET 2009


Hi,

Is there a way to get the enclosing function name within a function?

For example, I would like to have a function getEnclosingFunctionName().
It works like below

f = function(){
  print(getEnclosingFunctionName())

}


f()  # will print  "f"


Thanks

Jeff




More information about the R-help mailing list