Get global function calls from a function
Note the results are approximate only. R's dynamic nature does not allow us to always find the global calls reliably.
get_global_calls(func, funcname, envir = parent.frame())
- The function to examine.
- Name of the function.
- The environment containing the function. This environment is also used to look for S3 methods.
Calls can be:
- Direct function calls.
- Function calls via
- Calls to external functions via
- We assume that an S3 generic calls all its methods in the supplied environment.
Internally we use
findGlobals for finding
the global calls and variables.
Note that by default calls to base function are also included in the
result, even of they are primitive functions (e.g.
A data frame of function calls and call types.