-
Notifications
You must be signed in to change notification settings - Fork 758
/
dependencies.Rmd
109 lines (82 loc) · 3.27 KB
/
dependencies.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
title: "Devtools dependencies"
author: "Jim Hester, Hadley Wickham"
date: "`r Sys.Date()`"
output:
rmarkdown::html_vignette:
keep_md: true
vignette: >
%\VignetteIndexEntry{Devtools dependencies}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
# Package remotes
Devtools version 1.9 supports package dependency installation for packages not
yet in a standard package repository such as [CRAN](https://cran.r-project.org)
or [Bioconductor](http://bioconductor.org).
You can mark any regular dependency defined in the `Depends`, `Imports`,
`Suggests` or `Enhances` fields as being installed from a remote location by
adding the remote location to `Remotes` in your `DESCRIPTION` file. This will
cause devtools to download and install them prior to installing your package (so they won't be installed from CRAN).
The remote dependencies specified in `Remotes` should be described in the following form.
```
Remotes: [type::]<Repository>, [type2::]<Repository2>
```
The `type` is an optional parameter. If the type is missing the default is
to install from GitHub. Additional remote dependencies should be separated by
commas, just like normal dependencies elsewhere in the `DESCRIPTION` file.
It is important to remember that you **must always declare the dependency in the usual way**, i.e. include it in `Depends`, `Imports`, `Suggests` or `Enhances`. The `Remotes` field only provides instructions on where to install the dependency from. In this example `DESCRIPTION` file, note how rlang appears in `Imports` and in `Remotes`:
```
Package: xyz
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9000
Authors@R:
person(given = "First",
family = "Last",
role = c("aut", "cre"),
email = "[email protected]")
Description: What the package does (one paragraph).
License: MIT + file LICENSE
Imports:
rlang
Remotes:
r-lib/rlang
```
### GitHub
Because GitHub is the most commonly used unofficial package distribution in R, it's the default:
```yaml
Remotes: hadley/testthat
```
You 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 HEAD of the branch is used.
```yaml
Remotes: hadley/[email protected],
klutometis/roxygen#142,
hadley/testthat@c67018fa4970
```
A type of `github` can be specified, but is not required
```yaml
Remotes: github::hadley/ggplot2
```
### Other sources
All of the currently supported install sources are available, see the 'See
Also' section in `?install` for a complete list.
```yaml
# GitLab
Remotes: gitlab::jimhester/covr
# Git
Remotes: git::[email protected]:djnavarro/lsr.git
# Bitbucket
Remotes: bitbucket::sulab/mygene.r@default, djnavarro/lsr
# Bioconductor
Remotes: bioc::3.3/SummarizedExperiment#117513, bioc::release/Biobase
# SVN
Remotes: svn::https://github.com/tidyverse/stringr
# URL
Remotes: url::https://github.com/tidyverse/stringr/archive/main.zip
# Local
Remotes: local::/pkgs/testthat
# Gitorious
Remotes: gitorious::r-mpc-package/r-mpc-package
```
### CRAN submission
When you submit your package to CRAN, all of its dependencies must also be available on CRAN. For this reason, `release()` will warn you if you try to release a package with a `Remotes` field.