findGlobals: Find Global Functions and Variables Used by a Closure

Description Usage Arguments Details Value Author(s) Examples

View source: R/codetools.R

Description

Finds global functions and variables used by a closure.

Usage

1

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

1
2

Example output

 [1] "<-"           "=="           "assign"       "c"            "collectUsage"
 [6] "if"           "list"         "ls"           "mkHash"       "sort"        
[11] "unique"       "{"           
$functions
 [1] "<-"           "=="           "assign"       "c"            "collectUsage"
 [6] "if"           "list"         "ls"           "mkHash"       "sort"        
[11] "unique"       "{"           

$variables
character(0)

codetools documentation built on Nov. 8, 2020, 4:31 p.m.