1---
2title: "Dependency resolution for R package development"
3author: "Jim Hester, Hadley Wickham, Gábor Csárdi"
4date: "`r Sys.Date()`"
5output:
6  rmarkdown::html_vignette:
7    keep_md: true
8vignette: >
9  %\VignetteIndexEntry{Dependency resolution for R package development}
10  %\VignetteEngine{knitr::rmarkdown}
11  %\VignetteEncoding{UTF-8}
12---
13
14# Package remotes
15
16Remotes, just like devtools, supports package dependency installation for packages not
17yet in a standard package repository such as [CRAN](https://cran.r-project.org)
18or [Bioconductor](http://bioconductor.org).
19
20You can mark any regular dependency defined in the `Depends`, `Imports`,
21`Suggests` or `Enhances` fields as being installed from a remote location by
22adding the remote location to `Remotes` in your `DESCRIPTION` file. This will
23cause remotes to download and install them from the specified location,
24instead of CRAN.
25
26The remote dependencies specified in `Remotes` should be described in the following form.
27
28```
29Remotes: [type::]<Repository>, [type2::]<Repository2>
30```
31
32The `type` is an optional parameter.  If the type is missing the default is
33to install from GitHub. Additional remote dependencies should be separated by
34commas, just like normal dependencies elsewhere in the `DESCRIPTION` file.
35
36### GitHub
37
38Because GitHub is the most commonly used unofficial package distribution in R, it's the default:
39
40```yaml
41Remotes: r-lib/testthat
42```
43
44You can also specify a specific hash, tag, or pull request (using the same syntax as `install_github()` if you want a particular commit. Otherwise the latest commit on the default branch is used.
45
46```yaml
47Remotes: r-lib/httr@v0.4,
48  klutometis/roxygen#142,
49  r-lib/testthat@c67018fa4970
50```
51
52The special `@*release` syntax will install the latest release:
53
54```yaml
55Remotes: r-lib/testthat@*release
56```
57
58A type of 'github' can be specified, but is not required
59
60```yaml
61Remotes: github::tidyverse/ggplot2
62```
63
64### Other sources
65
66All of the currently supported install sources are available, see the 'See
67Also' section in `?install_github` for a complete list.
68
69```yaml
70# GitLab
71Remotes: gitlab::jimhester/covr
72
73# Git
74Remotes: git::git@bitbucket.org:djnavarro/lsr.git,
75  git::https://github.com/igraph/rigraph.git@master
76
77# Bitbucket
78Remotes: bitbucket::sulab/mygene.r@default, djnavarro/lsr
79
80# Bioconductor
81Remotes: bioc::3.3/SummarizedExperiment#117513, bioc::release/Biobase
82
83# SVN
84Remotes: svn::https://github.com/tidyverse/stringr
85
86# URL
87Remotes: url::https://github.com/tidyverse/stringr/archive/HEAD.zip
88
89# Local
90Remotes: local::/pkgs/testthat
91```
92
93### CRAN submission
94
95When you submit your package to CRAN, all of its dependencies must also be available on CRAN. For this reason, `devtools::release()` will warn you if you try to release a package with a `Remotes` field.
96