Title: | Provision a Library |
---|---|
Description: | Provision a set of packages into a new library, possibly for use on a different architecture. |
Authors: | Rich FitzJohn |
Maintainer: | Rich FitzJohn <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.14 |
Built: | 2024-11-04 05:34:56 UTC |
Source: | https://github.com/mrc-ide/provisionr |
Utility function for checking an R version
check_r_version(version = NULL)
check_r_version(version = NULL)
version |
Something to coerce into an R version. Valid
values are |
Download a fraction of CRAN to serve locally.
download_cran(packages, path, r_version = NULL, target = "windows", suggests = FALSE, package_sources = NULL, missing_index_is_error = TRUE, progress = NULL)
download_cran(packages, path, r_version = NULL, target = "windows", suggests = FALSE, package_sources = NULL, missing_index_is_error = TRUE, progress = NULL)
packages |
Character vector of packages to download |
path |
Destination |
r_version |
Target R version |
target |
Target platform (use "ALL" for all platforms) |
suggests |
Include suggested packages too? |
package_sources |
A |
missing_index_is_error |
Is a missing PACKAGES index an
error? Set this to |
progress |
Control progress bar printing |
Download multiple files.
download_files(urls, dest_dir, ..., labels = NULL, overwrite = FALSE, count = TRUE, dest_file = NULL, copy_file_urls = TRUE, progress = NULL, report = TRUE, headers = NULL)
download_files(urls, dest_dir, ..., labels = NULL, overwrite = FALSE, count = TRUE, dest_file = NULL, copy_file_urls = TRUE, progress = NULL, report = TRUE, headers = NULL)
urls |
A character vector of urls |
dest_dir |
A single existing directory to download files into |
... |
Currently ignored |
labels |
A character vector of labels to use to describe the
files being downloaded when printing (defaults to
|
overwrite |
Overwrite files that exist already? If
|
count |
Logical, indicating if a count of progress across the urls should be included. |
dest_file |
If the files should be renamed as they are
downloaded, include a vector of filenames here the same length
as |
copy_file_urls |
Logical, indicating if |
progress |
Print a progress bar? |
report |
Print a summary? |
headers |
Named character vector of HTTP headers (optional) |
A character vector, the same length as urls
, with
the destination file paths (even if no downloading was done). A
failure to download a file (e.g., a 403 forbidden, 404 not
found, or general network error) will result in an R error.
Collect information on package sources
package_sources(cran = NULL, repos = NULL, github = NULL, local = NULL, expire = NULL, local_drat = NULL, data = NULL, spec = NULL)
package_sources(cran = NULL, repos = NULL, github = NULL, local = NULL, expire = NULL, local_drat = NULL, data = NULL, spec = NULL)
cran |
A single URL for the CRAN repo to use. If
|
repos |
A character vector of additional repositories to use.
Repositories of the form |
github |
A vector of github package specifications (e.g.,
username/password). The full syntax as implemented in
|
local |
A character vector of local files to include. Can be directories or built packages (source or binary) |
expire |
Optional period, in days, to expire the local copy
of the package. If specified, then if a package was downloaded
more than |
local_drat |
Optional location to cache downloaded packages,
when |
data |
An object of class |
spec |
Raw entries of the form |
Provision dependencies for a package. The
provision_dependencies_bootstrap
function writes out a
bootstrap script.
provision_dependencies(lib, path_description = ".", ..., src = NULL, read_travis = FALSE) provision_dependencies_bootstrap(lib = ".packages", src = NULL, read_travis = FALSE, strict_lib = TRUE)
provision_dependencies(lib, path_description = ".", ..., src = NULL, read_travis = FALSE) provision_dependencies_bootstrap(lib = ".packages", src = NULL, read_travis = FALSE, strict_lib = TRUE)
lib |
Library to provision |
path_description |
Path to the |
... |
Additional arguments to |
src |
An optional description of additional packages, using
|
read_travis |
Logical, indicating if the |
strict_lib |
Should the bootstrap script install provisionr within the local library too? |
Create or update a library of packages.
provision_library(packages, lib, platform = NULL, version = NULL, src = NULL, check_dependencies = TRUE, installed_action = "upgrade", allow_missing = FALSE, refresh_drat = FALSE, quiet = FALSE, progress = NULL)
provision_library(packages, lib, platform = NULL, version = NULL, src = NULL, check_dependencies = TRUE, installed_action = "upgrade", allow_missing = FALSE, refresh_drat = FALSE, quiet = FALSE, progress = NULL)
packages |
A character vector of packages to include |
lib |
A path to the library; if it does not exist, it will be created. If given as a vector of libraries (i.e., with more than one element) then packages will be installed into the first library, but subsequent libraries will be checked to make sure that dependencies are satisfied. |
platform |
The platform to create the library for. If
|
version |
The version of R to install packages for. By
default, we use the same version (major.minor) as the current
running R version. Otherwise provide the desired version number
as a string or |
src |
An optional description of additional packages, using
|
check_dependencies |
Logical, indicating if dependencies of
|
installed_action |
The behaviour when some packages are
already installed. Options are |
allow_missing |
For cross-installation (via
|
refresh_drat |
Logical indicating if the cache of packages
pointed to by |
quiet |
Passed through to to |
progress |
Passed through to the package downloading to control printing of the progress bar. |
Cross installation of binary files is difficult and I need to come up with a way of making that work nicely.
Rich FitzJohn