Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

findGlobals {codetools} R Documentation

Find Global Functions and Variables Used by a Closure

Description

Finds global functions and variables used by a closure.

Usage

findGlobals(fun, merge = TRUE) 

Arguments

fun

function object; usually a closure.

merge

logical

Details

The result is an approximation. R semantics only allow variables that might be local to be identified (and event that assumes no use of assign and rm).

Value

Character vector if merge is true; otherwise, a list with functions and variables character vector components. Character vectors are of length zero For non-closures.

Author(s)

Luke Tierney

Examples

findGlobals(findGlobals)
findGlobals(findGlobals, merge = FALSE)

[Package codetools version 0.2-18 Index]
codetools

Code Analysis Tools for R

v0.2-18
GPL
Authors
Luke Tierney <luke-tierney@uiowa.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.