R Package Installation from Remote Repositories, Including 'GitHub'
Download and install R packages stored in 'GitHub',
'BitBucket', or plain 'subversion' or 'git' repositories. This package
provides the 'install_*' functions in 'devtools'.
Indeed most of the code was copied over from 'devtools'.
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
Indeed most of the code was copied over from
- Install packages with their dependencies.
- Install from GitHub, GitLab, BitBucket.
- Install from git and subversion repositories.
- Install from local files or URLs.
- Install the dependencies of a local package tree.
- Install specific package versions from CRAN.
- Supports Bioconductor packages.
- Supports the
DESCRIPTION. See more here.
- Supports the
- Can install itself from GitHub (see below).
- Does not depend on other R packages.
- Does not contain compiled code, so no compiler is needed.
- Does not need any external software (for most of the functionality at least).
Install the released 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
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
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
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.
Dependencies on GitHub
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,
assumed. Other possible values:
See more about the
Remotes field in this
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.
Currently supported remote types
- GitHub repositories via
- Bitbucket repositories via
- Generic git repositories via
install_git. They need either a system git installation, or the git2r R package.
- Local directories or package archive files via
- Remote package archive files via
- Packages in subversion repositories via
install_svn. They need a system subversion installation.
- Specific package versions from CRAN or other CRAN-like
install_version. This includes outdated and archived packages as well.
- All dependencies of a package in a local directory via
- For R older than 3.2, the curl package is required as remotes falls back
curl::curl_downloadin that case
- For R newer than 3.3, default
download.file()method is used. (
method = "auto")
- For in between versions,
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
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.
remotes uses the following standard R options, see
?options for their
download.file.methodfor the default download method. See
pkgTypefor the package type (source or binary, see manual) to install, download or look up dependencies for.
reposfor the locations of the user's standard CRAN(-like) repositoies.
It also uses some remotes specific options:
BioC_gitfor the URL of the default Bioconductor git mirror.
unzipfor the path of the external
BITBUCKET_PASSWORDenrironment variables are used for the default BitBucket user name and password, in
GITHUB_PATenvironment variable is used as the default GitHub personal access token for all GitHub API queries.
R_REMOTES_UPGRADEenvironment variable can be used to set a default preferred value for the
upgrade =argument accepted by the various
install_*()functions. For example, you can set
R_REMOTES_UPGRADE=alwaysto upgrade dependent packages without asking the user.
R_REMOTES_STANDALONE=trueforces 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=trueavoids 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_WARNINGSis 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.
GPL (>= 2) © Mango Solutions, RStudio
Functions in remotes
|install_gitlab||Install a package from GitLab|
|standardise_dep||Standardise dependencies using the same logical as install.packages|
|install_local||Install a package from a local file|
|bioc_install_repos||Deduce the URLs of the BioConductor repositories|
|update_packages||Update packages that are missing or out-of-date.|
|install_github||Attempts to install a package directly from GitHub.|
|install_cran||Attempts to install a package from CRAN.|
|install_bitbucket||Install a package directly from bitbucket|
|install_svn||Install a package from a SVN repository|
|install_version||Install specified version of a CRAN package.|
|package_deps||Find all dependencies of a CRAN or dev package.|
|install_url||Install a package from a url|
|install_bioc||Install a package from a Bioconductor repository|
|install_deps||Install package dependencies if needed.|
|download_version||Download a specified version of a CRAN package|
|install_dev||Install the development version of a package|
|gitlab_pat||Retrieve GitLab personal access token.|
|install_git||Install a package from a git repository|
|parse-git-repo||Parse a remote git repo specification|
Vignettes of remotes
Last month downloads
|License||GPL (>= 2)|
|SystemRequirements||Subversion for install_svn, git for install_git|
|Packaged||2019-04-10 14:53:06 UTC; jhester|
|Date/Publication||2019-04-10 16:32:54 UTC|
|suggests||brew , callr , covr , curl , git2r (>= 0.23.0) , knitr , mockery , pingr , pkgbuild (>= 1.0.1) , rmarkdown , rprojroot , testthat , withr|
|imports||methods , stats , tools , utils|
|depends||R (>= 3.0.0)|
|Contributors||Dan Tenenbaum, RStudio, Hadley Wickham, Winston Chang, Gabor Csardi, Mango Solutions, Martin Morgan|
Include our badge in your README