loadModule
will be included in the source
code for a package to load modules and optionally expose objects from
them. The actual extraction of the module takes place at load time.loadModule(module, what = , loadNow, env =)
setRcppClass()
setRcppClass()
, which does the necessary
module loading for you.When the module can be started (at namespace load time), the function
Module()
returns an environment with a description of
the module's contents. Function loadModule()
saves this as a
metadata object in the package namespace. Therefore multiple calls to
loadModule()
are an efficient way to extract different objects
from the module.
Requesting an object that does not exist in the module produces a warning.
Since assignments from the call cannot take place until namespace
loading time, any computations using the objects must also be
postponed until this time. Use load actions
(setLoadAction
) and make sure that the load action is
specified after the call to loadModule()
.
setRcppClass()
to avoid the explicit call.loadRcppModules()
for a shotgun procedure to load all
modules.
loadModule("yada", TRUE) # load all the objects from module "yada"
Run the code above in your browser using DataLab