Identify Globals and Packages of a Map-Reduce Function Call
Source:R/get_globals_and_packages_xapply.R
get_globals_and_packages_xapply.Rd
Identify Globals and Packages of a Map-Reduce Function Call
Usage
get_globals_and_packages_xapply(
fun,
fun_name = as.character(substitute(fun)),
args = NULL,
args_name = "...",
globals = TRUE,
packages = NULL,
envir = parent.frame()
)
Arguments
- fun
A function that takes one or more arguments.
- fun_name
The name of the argument that
fun
should be passed as.- args
(optional) A list of arguments passed to
fun
, either via a named argument (args_name
), or via ....- args_name
If
"..."
, then the arguments inargs
are passed tofun()
as individual arguments. If a string, thenargs
as passed tofun()
via the argument of this name.- globals
(optional) a logical, a character vector, a named list, or a Globals object. If TRUE, globals are identified by code inspection based on
expr
andtweak
searching from environmentenvir
. If FALSE, no globals are used. If a character vector, then globals are identified by lookup based their namesglobals
searching from environmentenvir
. If a named list or a Globals object, the globals are used as is.- packages
(optional) a character vector specifying packages to be attached in the R environment evaluating the future.
- envir
The environment from where globals should be searched.
Value
A names list with elements:
globals
- a FutureGlobals objectpackages
- a character vector of package names