Install R Packages from GitHub, BitBucket, or other local or remote repositories
Download and install R packages stored in GitHub, BitBucket, or plain subversion or git repositories. This package is a lightweight replacement of the
install_* functions in
devtools. Indeed most of the code was copied over from
DESCRIPTION. See more here.
Install the relesed version of remotes from CRAN:
You can also install remotes from GitHub. If you already have a previous version of remotes installed, you can use that to install the development version:
Alternatively, you can also call the supplied
install-github.R file directly, from within R:
The https://install-github.me service is also based on remotes. You can use it to install any R package from GitHub via sourcing a URL. E.g. to install remotes itself:
Note that most of the examples here use GitHub. See below for other supported repository types.
To install the latest version of a package in the
master branch from GitHub, you can use the
user/repo form. Note that
user can also be an organization:
If the R package is inside a subdirectory of the root directory, then give this subdirectory as well:
To install a certain branch or commit or tag, append it to the repo name, after an
To install the latest release, append
@*release to the repo name:
To install a pull request, append
# and the id (an integer number) of the pull request to the repo name:
Dependencies are automatically installed from CRAN. By default, outdated dependencies are automatically upgraded. In interactive sessions you can select a subset of the dependencies to upgrade.
It is also possible to install dependencies from GitHub or other supported repositories. For this you need to add a
Remotes field to the
DESCRIPTION file. Its format is:
Remotes: [remote::]repo_spec, [remote::]repo_spec, ...
repo_spec is any repository specification the corresponding
install_() function can handle. If
remote:: is missing,
github:: is assumed. Other possible values:
See more about the
Remotes field in this vignette.
remotes supports the
Additional_repositories field in
DESCRIPTION. This is a way to specify dependencies from non-CRAN package repositories. See the Writing R extensions manual for details.
BioConductor packages are automatically detected and their dependencies are installed from BioConductor. The BiocInstaller package, which is needed to install them, is also automatically installed temporarily.
install_git. They need either a system git installation, or the git2r R package.
install_svn. They need a system subversion installation.
install_version. This includes outdated and archived packages as well.
curl::curl_downloadin that case
download.file()method is used. (
method = "auto")
method = "wininet"is used on windows OS
method = "libcurl"is used on other OS, if available.
help("download.file") for informations on these methods and for setting proxies if needed.
remotes will use the curl, git2r and pkgbuild packages if they are installed to provide faster implementations for some aspects of the install process. However if you are using remotes to install or update these packages (or their reverse dependencies) using them during installation may fail (particularly on Windows).
If you set the environment variable
R_REMOTES_STANDALONE=true ( e.g. in R
Sys.setenv(R_REMOTES_STANDALONE="true")) you can force remotes to operate in standalone mode and use only its internal R implementations. This will allow successful installation of these packages.
R_REMOTES_STANDALONE=true forces remotes to work in standalone mode and avoid loading its optional dependencies (curl, git2 and pkgbuild currently. See “Standalone mode” above.
R_REMOTES_NO_ERRORS_FROM_WARNINGS=true avoids stopping the installation for warning messages. Warnings usually mean installation errors, so by default remotes stops for a warning. However, sometimes other warnings might happen, that could be ignored by setting this environment variable.
R_REMOTES_NO_ERRORS_FROM_WARNINGS is unset will also avoid stopping the installation for error messages. This is done because a warning is generated during installation when not all Suggested packages are not available.