-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathrepo_add.Rd
150 lines (131 loc) · 6.84 KB
/
repo_add.Rd
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/repo.R
\name{repo_add}
\alias{repo_add}
\alias{repo_resolve}
\title{Add a new CRAN-like repository}
\usage{
repo_add(..., .list = NULL, username = NULL)
repo_resolve(spec, username = NULL)
}
\arguments{
\item{...}{Repository specifications, possibly named character vectors.
See details below.}
\item{.list}{List or character vector of repository specifications.
This argument is easier to use programmatically than \code{...}. See
details below.}
\item{username}{User name to set, for authenticated repositories, see
\code{\link[=repo_auth]{repo_auth()}}.}
\item{spec}{Repository specification, a possibly named character
scalar.}
}
\value{
\code{repo_resolve()} returns a named character scalar, the URL
of the repository.
}
\description{
Add a new repository to the list of repositories that pak uses to
look for packages.
}
\details{
\code{repo_add()} adds new repositories. It resolves the specified
repositories using \code{repo_resolve()} and then modifies the \code{repos}
global option.
\code{repo_add()} only has an effect in the current R session. If you
want to keep your configuration between R sessions, then set the
\code{repos} option to the desired value in your user or project \code{.Rprofile}
file.
}
\section{Repository specifications}{
The format of a repository specification is a named or unnamed
character scalar. If the name is missing, pak adds a name
automatically. The repository named \code{CRAN} is the main CRAN repository,
but otherwise names are informational.
Currently supported repository specifications:
\itemize{
\item URL pointing to the root of the CRAN-like repository. Example:
\if{html}{\out{<div class="sourceCode">}}\preformatted{https://cloud.r-project.org
}\if{html}{\out{</div>}}
\item \code{PPM@latest}, PPM (Posit Package Manager, formerly RStudio Package
Manager), the latest snapshot.
\item \verb{PPM@<date>}, PPM (Posit Package Manager, formerly RStudio Package
Manager) snapshot, at the specified date.
\item \verb{PPM@<package>-<version>} PPM snapshot, for the day after the
release of \verb{<version>} of \verb{<package>}.
\item \verb{PPM@R-<version>} PPM snapshot, for the day after R \verb{<version>}
was released.
}
Still works for dates starting from 2017-10-10, but now deprecated,
because MRAN is discontinued:
\itemize{
\item \verb{MRAN@<date>}, MRAN (Microsoft R Application Network) snapshot, at
the specified date.
\item \verb{MRAN@<package>-<version>} MRAN snapshot, for the
day after the release of \verb{<version>} of \verb{<package>}.
\item \verb{MRAN@R-<version>} MRAN snapshot, for the day
after R \verb{<version>} was released.
}
Notes:
\itemize{
\item See more about PPM at \url{https://packagemanager.posit.co/client/#/}.
\item The \verb{RSPM@} prefix is still supported and treated the same way as
\verb{PPM@}.
\item The MRAN service is now retired, see
\verb{https://techcommunity.microsoft.com/blog/azuresqlblog/microsoft-r-application-network-retirement/3707161}
for details.
\item \code{MRAN@...} repository specifications now resolve to PPM, but note that
PPM snapshots are only available from 2017-10-10. See more about this
at \url{https://posit.co/blog/migrating-from-mran-to-posit-package-manager/}.
\item All dates (or times) can be specified in the ISO 8601 format.
\item If PPM does not have a snapshot available for a date, the next
available date is used.
\item Dates that are before the first, or after the last PPM snapshot
will trigger an error.
\item Unknown R or package versions will trigger an error.
}
}
\section{Examples}{
\if{html}{\out{<div class="sourceCode r">}}\preformatted{repo_add(PPMdplyr100 = "[email protected]")
repo_get()
}\if{html}{\out{</div>}}\if{html}{\out{
<div class="asciicast" style="color: #172431;font-family: 'Fira Code',Monaco,Consolas,Menlo,'Bitstream Vera Sans Mono','Powerline Symbols',monospace;line-height: 1.300000"><pre>
#> <span style="color: #999999;"># A data frame: 7 × 5</span>
#> name url type r_version bioc_version
#> <span style="color: #c2c2c2;">*</span> <span style="font-style: italic;color: #999999;"><chr></span> <span style="font-style: italic;color: #999999;"><chr></span> <span style="font-style: italic;color: #999999;"><chr></span> <span style="font-style: italic;color: #999999;"><chr></span> <span style="font-style: italic;color: #999999;"><chr></span>
#> <span style="color: #c2c2c2;">1</span> CRAN https://cloud.r-project.org cran * <span style="color: #DC322F;">NA</span>
#> <span style="color: #c2c2c2;">2</span> PPMdplyr100 https://packagemanager.pos… cran… * <span style="color: #DC322F;">NA</span>
#> <span style="color: #c2c2c2;">3</span> BioCsoft https://bioconductor.org/p… bioc 4.4.2 3.20
#> <span style="color: #c2c2c2;">4</span> BioCann https://bioconductor.org/p… bioc 4.4.2 3.20
#> <span style="color: #c2c2c2;">5</span> BioCexp https://bioconductor.org/p… bioc 4.4.2 3.20
#> <span style="color: #c2c2c2;">6</span> BioCworkflows https://bioconductor.org/p… bioc 4.4.2 3.20
#> <span style="color: #c2c2c2;">7</span> BioCbooks https://bioconductor.org/p… bioc 4.4.2 3.20
</pre></div>
}}
\if{html}{\out{<div class="sourceCode r">}}\preformatted{repo_resolve("PPM@2020-01-21")
}\if{html}{\out{</div>}}\if{html}{\out{
<div class="asciicast" style="color: #172431;font-family: 'Fira Code',Monaco,Consolas,Menlo,'Bitstream Vera Sans Mono','Powerline Symbols',monospace;line-height: 1.300000"><pre>
#> CRAN
#> "https://packagemanager.posit.co/cran/2020-01-21"
</pre></div>
}}
\if{html}{\out{<div class="sourceCode r">}}\preformatted{repo_resolve("[email protected]")
}\if{html}{\out{</div>}}\if{html}{\out{
<div class="asciicast" style="color: #172431;font-family: 'Fira Code',Monaco,Consolas,Menlo,'Bitstream Vera Sans Mono','Powerline Symbols',monospace;line-height: 1.300000"><pre>
#> CRAN
#> "https://packagemanager.posit.co/cran/2020-05-30"
</pre></div>
}}
\if{html}{\out{<div class="sourceCode r">}}\preformatted{repo_resolve("[email protected]")
}\if{html}{\out{</div>}}\if{html}{\out{
<div class="asciicast" style="color: #172431;font-family: 'Fira Code',Monaco,Consolas,Menlo,'Bitstream Vera Sans Mono','Powerline Symbols',monospace;line-height: 1.300000"><pre>
#> CRAN
#> "https://packagemanager.posit.co/cran/2020-04-25"
</pre></div>
}}
}
\seealso{
Other repository functions:
\code{\link{repo_get}()},
\code{\link{repo_status}()}
}
\concept{repository functions}