functionMap (version 1.0.0)

get_global_calls: Get global function calls from a function

Description

Note the results are approximate only. R's dynamic nature does not allow us to always find the global calls reliably.

Usage

get_global_calls(func, funcname, envir = parent.frame())

Arguments

func
The function to examine.
funcname
Name of the function.
envir
The environment containing the function. This environment is also used to look for S3 methods.

Value

A data frame of function calls and call types.

Details

Calls can be:
  • Direct function calls.
  • Function calls via do.call.
  • Calls to external functions via .C, .Call, etc.
  • 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. <-, ==, etc.).