Title: | R Package Installation from Remote Repositories, Including 'GitHub' |
---|---|
Description: | Download and install R packages stored in 'GitHub', 'GitLab', 'Bitbucket', 'Bioconductor', or plain 'subversion' or 'git' repositories. This package provides the 'install_*' functions in 'devtools'. Indeed most of the code was copied over from 'devtools'. |
Authors: | Gábor Csárdi [aut, cre], Jim Hester [aut], Hadley Wickham [aut], Winston Chang [aut], Martin Morgan [aut], Dan Tenenbaum [aut], Posit Software, PBC [cph, fnd], Ascent Digital Services [cph] |
Maintainer: | Gábor Csárdi <[email protected]> |
License: | MIT + file LICENSE |
Version: | 2.5.0.9000 |
Built: | 2024-12-09 06:15:36 UTC |
Source: | https://github.com/r-lib/remotes |
It downloads the package to a temporary file, and returns the name of the file.
download_version( package, version = NULL, repos = getOption("repos"), type = getOption("pkgType"), ... )
download_version( package, version = NULL, repos = getOption("repos"), type = getOption("pkgType"), ... )
package |
Name of the package to install. |
version |
Version of the package to install. Can either be a string giving the exact version required, or a specification in the same format as the parenthesized expressions used in package dependencies. One of the following formats:
|
repos |
character vector, the base URL(s) of the repositories
to use, e.g., the URL of a CRAN mirror such as
Can be |
type |
character, indicating the type of package to download and
install. Will be |
... |
Other arguments passed on to |
Name of the downloaded file.
Use as ref
parameter to install_github()
.
Allows installing a specific pull request or the latest release.
github_pull(pull) github_release()
github_pull(pull) github_release()
pull |
Character string specifying the pull request to install |
github_pull("42")
github_pull("42")
This function requires git
to be installed on your system in order to
be used.
install_bioc( repo, mirror = getOption("BioC_git", download_url("git.bioconductor.org/packages")), git = c("auto", "git2r", "external"), dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
install_bioc( repo, mirror = getOption("BioC_git", download_url("git.bioconductor.org/packages")), git = c("auto", "git2r", "external"), dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
repo |
Repository address in the format
|
mirror |
The Bioconductor git mirror to use |
git |
Whether to use the |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
force |
Force installation, even if the remote state has not changed since the previous install. |
quiet |
If |
build |
If |
build_opts |
Options to pass to |
build_manual |
If |
build_vignettes |
If |
repos |
A character vector giving repositories to use. |
type |
Type of package to |
... |
Other arguments passed on to |
It is vectorised so you can install multiple packages with a single command.
This is intended as an aid for Bioconductor developers. If you want to
install the release version of a Bioconductor package one can use the
BiocManager
package.
Other package installation:
install_bitbucket()
,
install_cran()
,
install_dev()
,
install_github()
,
install_gitlab()
,
install_git()
,
install_local()
,
install_svn()
,
install_url()
,
install_version()
## Not run: install_bioc("SummarizedExperiment") install_bioc("devel/SummarizedExperiment") install_bioc("3.3/SummarizedExperiment") install_bioc("SummarizedExperiment#abc123") install_bioc("user:password@release/SummarizedExperiment") install_bioc("user:password@devel/SummarizedExperiment") install_bioc("user:password@SummarizedExperiment#abc123") ## End(Not run)
## Not run: install_bioc("SummarizedExperiment") install_bioc("devel/SummarizedExperiment") install_bioc("3.3/SummarizedExperiment") install_bioc("SummarizedExperiment#abc123") install_bioc("user:password@release/SummarizedExperiment") install_bioc("user:password@devel/SummarizedExperiment") install_bioc("user:password@SummarizedExperiment#abc123") ## End(Not run)
This function is vectorised so you can install multiple packages in a single command.
install_bitbucket( repo, ref = "HEAD", subdir = NULL, auth_user = bitbucket_user(), password = bitbucket_password(), host = "api.bitbucket.org/2.0", dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
install_bitbucket( repo, ref = "HEAD", subdir = NULL, auth_user = bitbucket_user(), password = bitbucket_password(), host = "api.bitbucket.org/2.0", dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
repo |
Repository address in the format
|
ref |
Desired git reference; could be a commit, tag, or branch name. Defaults to HEAD. |
subdir |
Subdirectory within repo that contains the R package. |
auth_user |
your account username if you're attempting to install
a package hosted in a private repository (and your username is different
to |
password |
your password. Defaults to the |
host |
GitHub API host to use. Override with your GitHub enterprise
hostname, for example, |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
force |
Force installation, even if the remote state has not changed since the previous install. |
quiet |
If |
build |
If |
build_opts |
Options to pass to |
build_manual |
If |
build_vignettes |
If |
repos |
A character vector giving repositories to use. |
type |
Type of package to |
... |
Other arguments passed on to |
To install from a private repo, or more generally, access the
Bitbucket API with your own credentials, you will need to get an access
token. You can create an access token following the instructions found in
the
Bitbucket
App Passwords documentation. The App Password requires read-only access to
your repositories and pull requests. Then store your password in the
environment variable BITBUCKET_PASSWORD
(e.g. evelynwaugh:swordofhonour
)
Note that on Windows, authentication requires the "libcurl" download
method. You can set the default download method via the
download.file.method
option:
options(download.file.method = "libcurl")
In particular, if unset, RStudio sets the download method to "wininet".
To override this, you might want to set it to "libcurl" in your
R profile, see base::Startup. The caveat of the "libcurl" method is
that it does not set the system proxies automatically, see
"Setting Proxies" in utils::download.file()
.
Bitbucket API docs: https://confluence.atlassian.com/bitbucket/use-the-bitbucket-cloud-rest-apis-222724129.html
Other package installation:
install_bioc()
,
install_cran()
,
install_dev()
,
install_github()
,
install_gitlab()
,
install_git()
,
install_local()
,
install_svn()
,
install_url()
,
install_version()
## Not run: install_bitbucket("sulab/mygene.r@default") install_bitbucket("djnavarro/lsr") ## End(Not run)
## Not run: install_bitbucket("sulab/mygene.r@default") install_bitbucket("djnavarro/lsr") ## End(Not run)
This function is vectorised on pkgs
so you can install multiple
packages in a single command.
install_cran( pkgs, repos = getOption("repos"), type = getOption("pkgType"), dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, ... )
install_cran( pkgs, repos = getOption("repos"), type = getOption("pkgType"), dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, ... )
pkgs |
A character vector of packages to install. |
repos |
A character vector giving repositories to use. |
type |
Type of package to |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
force |
Force installation, even if the remote state has not changed since the previous install. |
quiet |
If |
build |
If |
build_opts |
Options to pass to |
build_manual |
If |
build_vignettes |
If |
... |
Other arguments passed on to |
Other package installation:
install_bioc()
,
install_bitbucket()
,
install_dev()
,
install_github()
,
install_gitlab()
,
install_git()
,
install_local()
,
install_svn()
,
install_url()
,
install_version()
## Not run: install_cran("ggplot2") install_cran(c("httpuv", "shiny")) ## End(Not run)
## Not run: install_cran("ggplot2") install_cran(c("httpuv", "shiny")) ## End(Not run)
Install package dependencies if needed.
install_deps( pkgdir = ".", dependencies = NA, repos = getOption("repos"), type = getOption("pkgType"), upgrade = c("default", "ask", "always", "never"), quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, ... )
install_deps( pkgdir = ".", dependencies = NA, repos = getOption("repos"), type = getOption("pkgType"), upgrade = c("default", "ask", "always", "never"), quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, ... )
pkgdir |
Path to a package directory, or to a package tarball. |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
repos |
A character vector giving repositories to use. |
type |
Type of package to |
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
quiet |
If |
build |
If |
build_opts |
Options to pass to |
build_manual |
If |
build_vignettes |
If |
... |
additional arguments passed to |
## Not run: install_deps(".")
## Not run: install_deps(".")
install_dev()
retrieves the package DESCRIPTION from the CRAN mirror and
looks in the 'URL' and 'BugReports' fields for GitHub, GitLab or Bitbucket
URLs. It then calls the appropriate install_()
function to install the
development package.
install_dev(package, cran_url = getOption("repos")[["CRAN"]], ...)
install_dev(package, cran_url = getOption("repos")[["CRAN"]], ...)
package |
The package name to install. |
cran_url |
The URL of the CRAN mirror to use, by default based on the 'repos' option. If unset uses 'https://cloud.r-project.org'. |
... |
Additional arguments passed to |
Other package installation:
install_bioc()
,
install_bitbucket()
,
install_cran()
,
install_github()
,
install_gitlab()
,
install_git()
,
install_local()
,
install_svn()
,
install_url()
,
install_version()
## Not run: # From GitHub install_dev("dplyr") # From GitLab install_dev("iemiscdata") # From Bitbucket install_dev("argparser") ## End(Not run)
## Not run: # From GitHub install_dev("dplyr") # From GitLab install_dev("iemiscdata") # From Bitbucket install_dev("argparser") ## End(Not run)
It is vectorised so you can install multiple packages with
a single command. You do not need to have the git2r
package,
or an external git client installed.
install_git( url, subdir = NULL, ref = NULL, branch = NULL, credentials = git_credentials(), git = c("auto", "git2r", "external"), dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
install_git( url, subdir = NULL, ref = NULL, branch = NULL, credentials = git_credentials(), git = c("auto", "git2r", "external"), dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
url |
Location of package. The url should point to a public or private repository. |
subdir |
A sub-directory within a git repository that may contain the package we are interested in installing. |
ref |
Name of branch, tag or SHA reference to use, if not HEAD. |
branch |
Deprecated, synonym for ref. |
credentials |
A git2r credentials object passed through to clone.
Supplying this argument implies using |
git |
Whether to use the |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
force |
Force installation, even if the remote state has not changed since the previous install. |
quiet |
If |
build |
If |
build_opts |
Options to pass to |
build_manual |
If |
build_vignettes |
If |
repos |
A character vector giving repositories to use. |
type |
Type of package to |
... |
Other arguments passed on to |
If you need to set git credentials for use in the Remotes
field you can do
so by placing the credentials in the remotes.git_credentials
global
option.
Other package installation:
install_bioc()
,
install_bitbucket()
,
install_cran()
,
install_dev()
,
install_github()
,
install_gitlab()
,
install_local()
,
install_svn()
,
install_url()
,
install_version()
## Not run: install_git("https://github.com/hadley/stringr.git") install_git("https://github.com/hadley/stringr.git", ref = "stringr-0.2") ## End(Not run)
## Not run: install_git("https://github.com/hadley/stringr.git") install_git("https://github.com/hadley/stringr.git", ref = "stringr-0.2") ## End(Not run)
This function is vectorised on repo
so you can install multiple
packages in a single command.
install_github( repo, ref = "HEAD", subdir = NULL, auth_token = github_pat(quiet), host = "api.github.com", dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
install_github( repo, ref = "HEAD", subdir = NULL, auth_token = github_pat(quiet), host = "api.github.com", dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
repo |
Repository address in the format
|
ref |
Desired git reference. Could be a commit, tag, or branch
name, or a call to |
subdir |
Subdirectory within repo that contains the R package. |
auth_token |
To install from a private repo, generate a personal
access token (PAT) with at least repo scope in
https://github.com/settings/tokens and
supply to this argument. This is safer than using a password because
you can easily delete a PAT without affecting any others. Defaults to
the |
host |
GitHub API host to use. Override with your GitHub enterprise
hostname, for example, |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
force |
Force installation, even if the remote state has not changed since the previous install. |
quiet |
If |
build |
If |
build_opts |
Options to pass to |
build_manual |
If |
build_vignettes |
If |
repos |
A character vector giving repositories to use. |
type |
Type of package to |
... |
Other arguments passed on to |
If the repository uses submodules a command-line git client is required to clone the submodules.
Other package installation:
install_bioc()
,
install_bitbucket()
,
install_cran()
,
install_dev()
,
install_gitlab()
,
install_git()
,
install_local()
,
install_svn()
,
install_url()
,
install_version()
## Not run: install_github("klutometis/roxygen") install_github("wch/ggplot2", ref = github_pull("142")) install_github(c("rstudio/httpuv", "rstudio/shiny")) install_github(c("hadley/[email protected]", "klutometis/roxygen#142", "r-lib/roxygen2@*release", "mfrasca/r-logging/pkg")) # To install from a private repo, use auth_token with a token # from https://github.com/settings/tokens. You only need the # repo scope. Best practice is to save your PAT in env var called # GITHUB_PAT. install_github("hadley/private", auth_token = "abc") # To pass option arguments to `R CMD INSTALL` use `INSTALL_opts`. e.g. to install a package with source references and tests install_github("rstudio/shiny", INSTALL_opts = c("--with-keep.source", "--install-tests")) ## End(Not run)
## Not run: install_github("klutometis/roxygen") install_github("wch/ggplot2", ref = github_pull("142")) install_github(c("rstudio/httpuv", "rstudio/shiny")) install_github(c("hadley/[email protected]", "klutometis/roxygen#142", "r-lib/roxygen2@*release", "mfrasca/r-logging/pkg")) # To install from a private repo, use auth_token with a token # from https://github.com/settings/tokens. You only need the # repo scope. Best practice is to save your PAT in env var called # GITHUB_PAT. install_github("hadley/private", auth_token = "abc") # To pass option arguments to `R CMD INSTALL` use `INSTALL_opts`. e.g. to install a package with source references and tests install_github("rstudio/shiny", INSTALL_opts = c("--with-keep.source", "--install-tests")) ## End(Not run)
This function is vectorised on repo
so you can install multiple
packages in a single command. Like other remotes the repository will skip
installation if force == FALSE
(the default) and the remote state has
not changed since the previous installation.
install_gitlab( repo, subdir = NULL, auth_token = gitlab_pat(quiet), host = "gitlab.com", dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
install_gitlab( repo, subdir = NULL, auth_token = gitlab_pat(quiet), host = "gitlab.com", dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
repo |
Repository address in the format
|
subdir |
Subdirectory within repo that contains the R package. |
auth_token |
To install from a private repo, generate a personal access token (PAT) with at least read_api scope in https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html and supply to this argument. This is safer than using a password because you can easily delete a PAT without affecting any others. Defaults to the GITLAB_PAT environment variable. |
host |
GitLab API host to use. Override with your GitLab enterprise
hostname, for example, |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
force |
Force installation, even if the remote state has not changed since the previous install. |
quiet |
If |
build |
If |
build_opts |
Options to pass to |
build_manual |
If |
build_vignettes |
If |
repos |
A character vector giving repositories to use. |
type |
Type of package to |
... |
Other arguments passed on to |
Other package installation:
install_bioc()
,
install_bitbucket()
,
install_cran()
,
install_dev()
,
install_github()
,
install_git()
,
install_local()
,
install_svn()
,
install_url()
,
install_version()
## Not run: install_gitlab("jimhester/covr") ## End(Not run)
## Not run: install_gitlab("jimhester/covr") ## End(Not run)
This function is vectorised so you can install multiple packages in a single command.
install_local( path = ".", subdir = NULL, dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = !is_binary_pkg(path), build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
install_local( path = ".", subdir = NULL, dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = !is_binary_pkg(path), build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
path |
path to local directory, or compressed file (tar, zip, tar.gz tar.bz2, tgz2 or tbz) |
subdir |
subdirectory within url bundle that contains the R package. |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
force |
Force installation, even if the remote state has not changed since the previous install. |
quiet |
If |
build |
If |
build_opts |
Options to pass to |
build_manual |
If |
build_vignettes |
If |
repos |
A character vector giving repositories to use. |
type |
Type of package to |
... |
Other arguments passed on to |
Other package installation:
install_bioc()
,
install_bitbucket()
,
install_cran()
,
install_dev()
,
install_github()
,
install_gitlab()
,
install_git()
,
install_svn()
,
install_url()
,
install_version()
## Not run: dir <- tempfile() dir.create(dir) pkg <- download.packages("testthat", dir, type = "source") install_local(pkg[, 2]) ## End(Not run)
## Not run: dir <- tempfile() dir.create(dir) pkg <- download.packages("testthat", dir, type = "source") install_local(pkg[, 2]) ## End(Not run)
This function requires svn
to be installed on your system in order to
be used.
install_svn( url, subdir = NULL, args = character(0), revision = NULL, dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
install_svn( url, subdir = NULL, args = character(0), revision = NULL, dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
url |
Location of package. The url should point to a public or private repository. |
subdir |
A sub-directory within a svn repository that contains the package we are interested in installing. |
args |
A character vector providing extra options to pass on to
|
revision |
svn revision, if omitted updates to latest |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
force |
Force installation, even if the remote state has not changed since the previous install. |
quiet |
If |
build |
If |
build_opts |
Options to pass to |
build_manual |
If |
build_vignettes |
If |
repos |
A character vector giving repositories to use. |
type |
Type of package to |
... |
Other arguments passed on to |
It is vectorised so you can install multiple packages with a single command.
Other package installation:
install_bioc()
,
install_bitbucket()
,
install_cran()
,
install_dev()
,
install_github()
,
install_gitlab()
,
install_git()
,
install_local()
,
install_url()
,
install_version()
## Not run: install_svn("https://github.com/hadley/stringr/trunk") install_svn("https://github.com/hadley/httr/branches/oauth") ## End(Not run)
## Not run: install_svn("https://github.com/hadley/stringr/trunk") install_svn("https://github.com/hadley/httr/branches/oauth") ## End(Not run)
This function is vectorised so you can install multiple packages in a single command.
install_url( url, subdir = NULL, dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
install_url( url, subdir = NULL, dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
url |
location of package on internet. The url should point to a zip file, a tar file or a bzipped/gzipped tar file. |
subdir |
subdirectory within url bundle that contains the R package. |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
force |
Force installation, even if the remote state has not changed since the previous install. |
quiet |
If |
build |
If |
build_opts |
Options to pass to |
build_manual |
If |
build_vignettes |
If |
repos |
A character vector giving repositories to use. |
type |
Type of package to |
... |
Other arguments passed on to |
Other package installation:
install_bioc()
,
install_bitbucket()
,
install_cran()
,
install_dev()
,
install_github()
,
install_gitlab()
,
install_git()
,
install_local()
,
install_svn()
,
install_version()
## Not run: install_url("https://github.com/hadley/stringr/archive/HEAD.zip") ## End(Not run)
## Not run: install_url("https://github.com/hadley/stringr/archive/HEAD.zip") ## End(Not run)
This function knows how to look in multiple CRAN-like package repositories, and in their
archive
directories, in order to find specific versions of the requested package.
install_version( package, version = NULL, dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = FALSE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = "source", ... )
install_version( package, version = NULL, dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = FALSE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = "source", ... )
package |
Name of the package to install. |
version |
Version of the package to install. Can either be a string giving the exact version required, or a specification in the same format as the parenthesized expressions used in package dependencies. One of the following formats:
|
dependencies |
logical indicating whether to also install
uninstalled packages which these packages depend on/link
to/import/suggest (and so on recursively).
Not used if Only supported if The default,
In all of these, |
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
force |
Force installation, even if the remote state has not changed since the previous install. |
quiet |
logical: if true, reduce the amount of output. This is not
passed to |
build |
If |
build_opts |
Options to pass to |
build_manual |
If |
build_vignettes |
If |
repos |
character vector, the base URL(s) of the repositories
to use, e.g., the URL of a CRAN mirror such as
Can be |
type |
character, indicating the type of package to download and
install. Will be |
... |
Other arguments passed on to |
The repositories are searched in the order specified by the repos
argument. This enables
teams to maintain multiple in-house repositories with different policies - for instance, one repo
for development snapshots and one for official releases. A common setup would be to first search
the official release repo, then the dev snapshot repo, then a public CRAN mirror.
Older versions of packages on CRAN are usually only available in source form. If your requested
package contains compiled code, you will need to have an R development environment installed. You
can check if you do by running devtools::has_devel
(you need the devtools
package for this).
Other package installation:
install_bioc()
,
install_bitbucket()
,
install_cran()
,
install_dev()
,
install_github()
,
install_gitlab()
,
install_git()
,
install_local()
,
install_svn()
,
install_url()
## Not run: install_version("devtools", "1.11.0") install_version("devtools", ">= 1.12.0, < 1.14") ## Specify search order (e.g. in ~/.Rprofile) options(repos = c( prod = "http://mycompany.example.com/r-repo", dev = "http://mycompany.example.com/r-repo-dev", CRAN = "https://cran.revolutionanalytics.com" )) install_version("mypackage", "1.15") # finds in 'prod' install_version("mypackage", "1.16-39487") # finds in 'dev' ## End(Not run)
## Not run: install_version("devtools", "1.11.0") install_version("devtools", ">= 1.12.0, < 1.14") ## Specify search order (e.g. in ~/.Rprofile) options(repos = c( prod = "http://mycompany.example.com/r-repo", dev = "http://mycompany.example.com/r-repo-dev", CRAN = "https://cran.revolutionanalytics.com" )) install_version("mypackage", "1.15") # finds in 'prod' install_version("mypackage", "1.16-39487") # finds in 'dev' ## End(Not run)
Find all the dependencies of a package and determine whether they are ahead
or behind CRAN. A print()
method identifies mismatches (if any)
between local and CRAN versions of each dependent package; an
update()
method installs outdated or missing packages from CRAN.
package_deps( packages, dependencies = NA, repos = getOption("repos"), type = getOption("pkgType") ) local_package_deps(pkgdir = ".", dependencies = NA) dev_package_deps( pkgdir = ".", dependencies = NA, repos = getOption("repos"), type = getOption("pkgType"), remote_precedence = TRUE, additional_repositories = TRUE ) ## S3 method for class 'package_deps' update( object, dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
package_deps( packages, dependencies = NA, repos = getOption("repos"), type = getOption("pkgType") ) local_package_deps(pkgdir = ".", dependencies = NA) dev_package_deps( pkgdir = ".", dependencies = NA, repos = getOption("repos"), type = getOption("pkgType"), remote_precedence = TRUE, additional_repositories = TRUE ) ## S3 method for class 'package_deps' update( object, dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
packages |
A character vector of package names. |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
repos |
A character vector giving repositories to use. |
type |
Type of package to |
pkgdir |
Path to a package directory, or to a package tarball. |
remote_precedence |
A logical flag specifying whether remote sources should take precedence over CRAN when both were found. |
additional_repositories |
A logical flag specifying whether |
object |
A |
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
force |
Force installation, even if the remote state has not changed since the previous install. |
quiet |
If |
build |
If |
build_opts |
Options to pass to |
build_manual |
If |
build_vignettes |
If |
... |
Additional arguments passed to |
A data.frame
with columns:
package |
The dependent package's name, |
installed |
The currently installed version, |
available |
The version available on CRAN, |
diff |
An integer denoting whether the locally installed version of the package is newer (1), the same (0) or older (-1) than the version currently available on CRAN. |
## Not run: package_deps("devtools") # Use update to update any out-of-date dependencies update(package_deps("devtools")) ## End(Not run)
## Not run: package_deps("devtools") # Use update to update any out-of-date dependencies update(package_deps("devtools")) ## End(Not run)
A remote repo can be specified in two ways:
parse_github_url()
handles HTTPS and SSH remote URLs
and various GitHub browser URLs
parse_repo_spec()
handles this concise form:
[username/]repo[/subdir][#pull|@ref|@*release]
parse_repo_spec(repo) parse_github_repo_spec(repo) parse_github_url(repo)
parse_repo_spec(repo) parse_github_repo_spec(repo) parse_github_url(repo)
repo |
Character scalar, the repo specification. |
List with members: username
, repo
, subdir
ref
, pull
, release
, some which will be empty.
parse_repo_spec("metacran/crandb") parse_repo_spec("jimhester/covr#47") ## pull request parse_repo_spec("jeroen/[email protected]") ## specific tag parse_repo_spec("tidyverse/dplyr@*release") ## shorthand for latest release parse_repo_spec("r-lib/remotes@550a3c7d3f9e1493a2ba") ## commit SHA parse_repo_spec("igraph=igraph/rigraph") ## Different package name from repo name parse_github_url("https://github.com/jeroen/curl.git") parse_github_url("[email protected]:metacran/crandb.git") parse_github_url("https://github.com/jimhester/covr") parse_github_url("https://github.example.com/user/repo.git") parse_github_url("[email protected]:user/repo.git") parse_github_url("https://github.com/r-lib/remotes/pull/108") parse_github_url("https://github.com/r-lib/remotes/tree/name-of-branch") parse_github_url("https://github.com/r-lib/remotes/commit/1234567") parse_github_url("https://github.com/r-lib/remotes/releases/latest") parse_github_url("https://github.com/r-lib/remotes/releases/tag/1.0.0")
parse_repo_spec("metacran/crandb") parse_repo_spec("jimhester/covr#47") ## pull request parse_repo_spec("jeroen/[email protected]") ## specific tag parse_repo_spec("tidyverse/dplyr@*release") ## shorthand for latest release parse_repo_spec("r-lib/remotes@550a3c7d3f9e1493a2ba") ## commit SHA parse_repo_spec("igraph=igraph/rigraph") ## Different package name from repo name parse_github_url("https://github.com/jeroen/curl.git") parse_github_url("[email protected]:metacran/crandb.git") parse_github_url("https://github.com/jimhester/covr") parse_github_url("https://github.example.com/user/repo.git") parse_github_url("[email protected]:user/repo.git") parse_github_url("https://github.com/r-lib/remotes/pull/108") parse_github_url("https://github.com/r-lib/remotes/tree/name-of-branch") parse_github_url("https://github.com/r-lib/remotes/commit/1234567") parse_github_url("https://github.com/r-lib/remotes/releases/latest") parse_github_url("https://github.com/r-lib/remotes/releases/tag/1.0.0")
Returns a character vector of commands to run that will install system requirements for the queried operating system.
system_requirements( os, os_release = NULL, path = ".", package = NULL, curl = Sys.which("curl") )
system_requirements( os, os_release = NULL, path = ".", package = NULL, curl = Sys.which("curl") )
os , os_release
|
The operating system and operating system release version, see https://github.com/rstudio/r-system-requirements#operating-systems for the list of supported operating systems. If |
path |
The path to the dev package's root directory. |
package |
CRAN package name(s) to lookup system requirements for. If not
|
curl |
The location of the curl binary on your system. |
A character vector of commands needed to install the system requirements for the package.
Works similarly to utils::install.packages()
but doesn't install packages
that are already installed, and also upgrades out dated dependencies.
update_packages( packages = TRUE, dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
update_packages( packages = TRUE, dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = getOption("pkgType"), ... )
packages |
Character vector of packages to update. |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
upgrade |
Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"
respects the value of the |
force |
Deprecated, this argument has no effect. |
quiet |
If |
build |
If |
build_opts |
Options to pass to |
build_manual |
If |
build_vignettes |
If |
repos |
A character vector giving repositories to use. |
type |
Type of package to |
... |
Other arguments passed on to |
package_deps()
to see which packages are out of date/
missing.
## Not run: update_packages("ggplot2") update_packages(c("plyr", "ggplot2")) ## End(Not run)
## Not run: update_packages("ggplot2") update_packages(c("plyr", "ggplot2")) ## End(Not run)