library.dynam(chname, package, lib.loc, verbose = getOption("verbose"), file.ext = .Platform$dynlib.ext, …)
library.dynam.unload(chname, libpath, verbose = getOption("verbose"), file.ext = .Platform$dynlib.ext)
dyn.loadto control how the library and its dependencies are loaded.
"DLLInfo"objects corresponding to the DLLs loaded by packages. Can be missing.
chnameis not specified,
library.dynamreturns an object of class
"DLLInfoList"corresponding to the DLLs loaded by packages. If
chnameis specified, an object of class
"DLLInfo"that identifies the DLL and which can be used in future calls is returned invisibly. Note that the class
"DLLInfo"has a method for
$which can be used to resolve native symbols within that DLL.
library.dynam.unloadinvisibly returns an object of class
"DLLInfo"identifying the DLL successfully unloaded.
.dynLibsreturns an object of class
"DLLInfoList"corresponding corresponding to its current value.
dyn.unloadon a DLL loaded by
library.dynam.unloadto ensure that
.dynLibsgets updated. Otherwise a subsequent call to
library.dynamwill be told the object is already loaded. Note that whether or not it is possible to unload a DLL and then reload a revised version of the same file is OS-dependent: see the ‘Value’ section of the help for
dyn.loadfor what sort of objects these functions handle.
library.dynamis designed to be used inside a package rather than at the command line, and should really only be used inside
.onLoad. The system-specific extension for DLLs (e.g.,
.slon Unix-alike systems,
.dllon Windows) should not be added. If
…does not include a named argument
dyn.loadis called with
DLLpathset to the package's
libsdirectory. See the “Windows” section of the help on
dyn.loadfor how to control where dependent DLLs are found. See
dyn.loadfor comments about diagnostic messages which may be seen on Windows.
library.dynam.unloadis designed for use in
.onUnload: it unloads the DLL and updates the value of
.dynLibsis used for getting (with no argument) or setting the DLLs which are currently loaded by packages (using
getLoadedDLLsfor information on
SHLIBfor how to create suitable DLLs.
## Which DLLs were dynamically loaded by packages? library.dynam()
Run the code above in your browser using DataCamp Workspace