setPackageExtraHandler {pkgmaker} | R Documentation |
Install/Run Extra Things After Standard Package Installation
Description
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
.
Usage
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")
)
Arguments
handler |
name of a handler, e.g, |
fun |
handler function that will be called with the arguments registered
with |
... |
extra arguments passed to internal function calls.
In In |
extra |
name of the extra action. |
package |
package name where to store/look for the internal registries. End users should not need to use this argument. |
.wrap |
logical that indicates if a function that runs the extra action should be returned or only the default arguments |
.verbose |
logical that indicates if verbose messages about the extra actions being run should be displayed. |
Value
the runner function associated with the newly registered handler,
as built by packageExtraRunner
.
Functions
-
packageExtraHandler()
: retrieves a given handler from the registry. -
setPackageExtra()
: registers extra actions for a given handler.For example, calling
setPackageExtra('install', pkgs='non_CRAN_pkg', repos='http://non-standard-repo')
in a source file of package 'myPkg' registers the callinstall.packages('non_CRAN_pkg', repos='http://non-standard-repo', ...)
in a registry internal to the package. All calls tosetPackageExtra('install', ...)
can then be run by the user, as a post installation step viainstall.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 functioninstall.extrapackages
is the runner defined for the extra handler'install'
viapackageExtraRunner('install')
. -
install.extras()
: runs all extra actions registered for a given package. -
install.extrapackages()
: install sets of packages that can enhance a package, but may not be available from CRAN.It is defined as the extra handler for the extra action handler
'install.packages'
. All arguments in...
are passed toinstall.packages
. By default, packages that are already installed are not re-installed. An extra argumentforce
allows to force their installation. The packages are loaded if their installation is successful.