hack_r_loaders {srcpkgs} | R Documentation |
instruments the R loaders to make them aware of source packages
Description
hacks library()
and loadNamespace()
using the base R tracer function trace()
.
library(pkg)
will basically call pkg_load(pkg)
if the source package pkg
is managed by srcpkgs
Usage
hack_r_loaders()
Details
N.B: usually you do not need to call that function explicitly. The function is reentrant.
Value
no return value, called for side-effects
Package startup
At package startup (actually .OnAttach()
), hack_r_loaders()
will be automatically called to hack
the R loaders, UNLESS this is inhibited via the option srcpkgs.inhibit_r_loaders_hack
or the
environment variable SRCPKGS.INHIBIT_R_LOADERS_HACK
. You may set any value like TRUE, "TRUE", 1 or "1".
See Also
Examples
# hack library
hack_r_loaders()
# unhack
unhack_r_loaders()
# prevent automatic hacking when srcpkgs is loaded
options(srcpkgs.inhibit_r_loaders_hack=TRUE)
# or
Sys.setenv(SRCPKGS.INHIBIT_R_LOADERS_HACK="1")
library(srcpkgs)
[Package srcpkgs version 0.1 Index]