View source: R/install_local_pkg.R
| install_local_pkg | R Documentation |
Installs a package from a local archive. Dependencies available as local
archives are installed recursively; missing non-local dependencies follow the
explicit cran_deps policy. ZIP archives containing Meta/package.rds are
treated as Windows binaries, while other ZIP archives are unpacked and
installed as source packages.
install_local_pkg(
package,
pkg_dir = NULL,
ext = ".tar.gz",
repos = NULL,
cran_deps = c("skip", "error", "install"),
verbose = getOption("bigbang.verbose", interactive()),
force = FALSE,
upgrade = c("newer", "always", "never"),
lib = .libPaths()[[1L]]
)
package |
Character. An existing archive path, or a package stem such
as |
pkg_dir |
Character. Optional directory or directories containing local
archives. It is not needed when |
ext |
Character. Fallback archive extension for stems; existing paths keep their own extension. |
repos |
Character. Repositories used only when |
cran_deps |
Character. Policy for missing non-local dependencies:
|
verbose |
Logical. Whether to emit progress and summary messages. The
default follows |
force |
Logical. Reinstall every local archive. This is a convenience
alias for |
upgrade |
Character. Installed-version policy: |
lib |
Character. Library in which the local component must be installed
and verified when supplied explicitly. When omitted, the legacy lookup
considers all of |
Archive entry names follow the bigbang.archive.portable_names option
described in scan_bigbang_artifact(). It is TRUE by default; set it to
FALSE only when every recipient uses Linux or macOS. Relaxed names warn
during installation and remain unavailable on Windows or on filesystems that
do not distinguish case. Case-only collisions are decided when the archive
is extracted; an earlier inspection without a destination defers that
decision. Components made only of dots and spaces, Windows-specific rules,
and security-critical path rules are never relaxed.
Invisibly, a list describing installed, unchanged, failed, and
skipped packages. Components that an upgrade policy left in place are
reported in unchanged, not in installed.
This function installs packages into lib, which defaults to the user's
active R library. When lib is supplied explicitly, a component found only
in another library is still installed into lib; non-local dependencies are
resolved from lib plus .libPaths(). When lib is omitted, an installed
component found anywhere on .libPaths() retains the pre-0.3.0 behavior.
Installation
occurs only when the user calls the function; loading bigbang never installs
packages. With the default cran_deps = "skip", it does not access the network.
An installed package can be kept without reading its archive when
upgrade = "never". Under the default policy, bigbang reads only the archive
DESCRIPTION first; if that metadata cannot be verified for an already
installed package, the installed package is kept and the reason is reported.
With upgrade = "never", the shortcut takes the component identity from the
archive filename because the archive is not read. Use upgrade = "newer" when
the declared Package field must be checked against the installed package.
create_metapackage() for generating a meta-package with an explicit
component installer; scan_bigbang_artifact() for the archive-name policy.
archive <- system.file(
"extdata", "toycomponent_0.1.0.tar.gz", package = "bigbang"
)
example_library <- tempfile("bigbang-example-library-")
dir.create(example_library)
on.exit(unlink(example_library, recursive = TRUE), add = TRUE)
install_local_pkg(archive, lib = example_library, verbose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.