datadr (version 0.8.4)

drGetGlobals: Get Global Variables and Package Dependencies

Description

Get global variables and package dependencies for a function

Usage

drGetGlobals(f)

Arguments

f
function

Value

  • a list of variables (named by variable) and a vector of package names

Details

This traverses the parent environments of the supplied function and finds all global variables using findGlobals and retrieves their values. All package function calls are also found and a list of required packages is also returned.

Examples

Run this code
a <- 1
f <- function(x) x + a
drGetGlobals(f)

Run the code above in your browser using DataLab