If the module as a name, defined by name(), it will always be used for the search path.
use(module, as, parent = baseenv(), lock = TRUE)
module | a module object, or path to a module file |
---|---|
as | name when attached to search; character |
parent | the enclosing environment |
lock | lock the environment; logical |
TRUE
if successful; invisible
module_path <- system.file("misc", "example_module.R", package = "mod") example_module <- acquire(module_path) # Attach module object to search path use(example_module) # or directly from file use(module_path, "example_module")