Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
NotificationsYou must be signed in to change notification settings

r-lib/remotes

Repository files navigation

Install R Packages from remote or local repositories, includingGitHub, GitLab, Bitbucket, and Bioconductor

R-CMD-checkCodecov test coverageCRAN Posit mirror downloadsLifecycle: stable

Download and install R packages stored in GitHub, GitLab, Bitbucket,Bioconductor, or plain subversion or git repositories. This package is alightweight replacement of theinstall_* functions indevtools. Indeed most of the codewas copied over fromdevtools.

Features

  • Installers:
    • 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.
  • SupportsBioconductor packages.
  • Supports theRemotes field inDESCRIPTION. See more in thedependenciesvignette.
  • Supports theAdditional_repositories field inDESCRIPTION.
  • 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 atleast).

Installation

Install the released version of remotes from CRAN:

install.packages("remotes")

Usage

Note that most of the examples here use GitHub. See below for othersupported repository types.

To install the latest version of a package in the default branch fromGitHub, you can use theuser/repo form. Note thatuser can also bean organization:

remotes::install_github("r-lib/conflicted")

If the R package is inside a subdirectory of the root directory, thengive this subdirectory as well:

# build = FALSE because of some specificities of XGBoost packageinstall_github("dmlc/xgboost/R-package",build=FALSE)

To install a certain branch or commit or tag, append it to the reponame, after an@:

remotes::install_github("gaborcsardi/pkgconfig@v2.0.0")

To install the latest release, append@*release to the repo name:

remotes::install_github("gaborcsardi/pkgconfig@*release")

To install a pull request, append# and the id (an integer number) ofthe pull request to the repo name:

remotes::install_github("r-lib/pkgconfig#7")

Dependencies

Dependencies are automatically installed from CRAN. By default, outdateddependencies are automatically upgraded. In interactive sessions you canselect a subset of the dependencies to upgrade.

Dependencies on GitHub

It is also possible to install dependencies from GitHub or othersupported repositories. For this you need to add aRemotes field totheDESCRIPTION file. Its format is:

Remotes: [remote::]repo_spec, [remote::]repo_spec, ...

whererepo_spec is any repository specification the correspondinginstall_() function can handle. Ifremote:: is missing,github::is assumed. Other possible values:gitlab::,bitbucket::,git::,local::,svn::,url::,version::,cran::,bioc::.

See more about theRemotes field in thisvignette.

Additional repositories

remotes supports theAdditional_repositories field inDESCRIPTION.This is a way to specify dependencies from non-CRAN packagerepositories. See theWriting Rextensionsmanual for details.

Bioconductor packages

Bioconductor packages are automatically detected and their dependenciesare installed from Bioconductor.

Currently supported remote types

  • GitHub repositories viainstall_github.
  • Bitbucket repositories viainstall_bitbucket.
  • Generic git repositories viainstall_git. They need either a systemgit installation, or thegit2r Rpackage.
  • Local directories or package archive files viainstall_local.
  • Remote package archive files viainstall_url.
  • Packages in subversion repositories viainstall_svn. They need asystem subversion installation.
  • Specific package versions from CRAN or other CRAN-like repositoriesviainstall_version. This includes outdated and archived packages aswell.
  • All dependencies of a package in a local directory viainstall_deps.

Download methods

  • For R older than 3.2, the curl package is required as remotes fallsback tocurl::curl_download in that case
  • For R newer than 3.3, defaultdownload.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.

Seehelp("download.file") for information on these methods and forsetting proxies if needed.

Standalone mode

remotes will use the curl, git2r and pkgbuild packages if they areinstalled to provide faster implementations for some aspects of theinstall process. However if you are using remotes to install or updatethese packages (or their reverse dependencies) using them duringinstallation may fail (particularly on Windows).

If you set the environment variableR_REMOTES_STANDALONE="true" (e.g.in RSys.setenv(R_REMOTES_STANDALONE="true")) you can force remotes tooperate in standalone mode and use only its internal R implementations.This will allow successful installation of these packages.

Options

remotes uses the following standard R options, see?options for theirdetails:

  • download.file.method for the default download method. See?download.file.

  • pkgType for the package type (source or binary, see manual) toinstall, download or look up dependencies for.

  • repos for the locations of the user’s standard CRAN(-like)repositories.

It also uses some remotes specific options:

  • BioC_git for the URL of the default Bioconductor git mirror.

  • BioC_mirror for the URL of the Bioconductor mirror.

  • unzip for the path of the externalunzip program.

Environment variables

  • TheBITBUCKET_USER andBITBUCKET_PASSWORD environment variablesare used for the default Bitbucket user name and password, ininstall_bitbucket()

  • TheGITHUB_PAT environment variable is used as the default GitHubpersonal access token for all GitHub API queries.

  • TheR_BIOC_MIRROR environment variable can be used to specify analternative Bioconductor mirror. (TheBioC_mirror option takesprecedence over this.)

  • TheR_BIOC_VERSION environment variable can be used to force aBioconductor version.

  • TheR_REMOTES_UPGRADE environment variable can be used to set adefault preferred value for theupgrade = argument accepted by thevariousinstall_*() functions. For example, you can setR_REMOTES_UPGRADE="always" to upgrade dependent packages withoutasking the user.

  • SettingR_REMOTES_STANDALONE="true" forces remotes to work instandalone mode and avoid loading its optional dependencies (curl,git2 and pkgbuild currently. See “Standalone mode” above.

  • SettingR_REMOTES_NO_ERRORS_FROM_WARNINGS="false" will cause warningmessages during calls toinstall.packages() to become errors. Oftenwarning messages are caused by dependencies failing to install.

License

GPL (>= 2) © Ascent Digital Services, Posit Software, PBC

About

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp