setPackageExtraHandler(handler, fun, ...) packageExtraHandler(handler = NULL, ...) setPackageExtra(handler, extra, ...) packageExtra(handler = NULL, extra = NULL, package = NULL, .wrap = FALSE) packageExtraRunner(handler) install.extras(package, extra = NULL, handler = NULL, ..., .verbose = getOption("verbose")) install.extrapackages(package, extra = NULL, handler = NULL, ..., .verbose = getOption("verbose"))
'install'
.
It must be unique across all handlers registered by any
other packages.packageExtra(name, ...)
packageExtraHandler
, these are passed to
pkgreg_fetch
.
In setPackageExtra
, these define default arguments
for the handler function. These are overwritten by
arguments in the call to runner function if any.the runner function associated with the newly registered
handler, as built by packageExtraRunner
.
These functions define a framework to register actions for which default sets of arguments can be defined when (lazy-)loading a package, and run later on, e.g., after the package is installed using dedicated commands.
setPackageExtraHandler
defines main action handler
functions, for which actions are defined as a set of
arguments and registered using setPackageExtra
.
packageExtraHandler
retrieves a given handler from
the registry.
For example, calling setPackageExtra('install',
pkgs='non_CRAN_pkg', repos='http://non-standard-repo')
in a source file of package 'myPkg' registers the call
install.packages('non_CRAN_pkg',
repos='http://non-standard-repo', ...)
in a registry
internal to the package. All calls to
setPackageExtra('install', ...)
can then be run by
the user, as a post installation step via
install.extrapackages('myPkg', ..)
.
packageExtra
retrieve a given extra action, either
as its registry entry, or as a function that would
perform the given action.
packageExtraRunner
defines a function to run all
or some of the actions registered for a given handler in
a given package. For example, the function
install.extrapackages
is the runner defined for
the extra handler 'install'
via
packageExtraRunner('install')
.
install.extrapackages
runs all extra actions
registered for a given package.
install.extrapackages
is defined as the extra
handler for the extra action handler
'install.packages'
. All arguments in ...
are passed to install.packages
. By default,
packages that are already installed are not re-installed.
An extra argument force
allows to force their
installation. The packages are loaded if their
installation is successful.