-
Notifications
You must be signed in to change notification settings - Fork 65
Specify extra repos in pkg_install()
#306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can add extra repos with ❯ pak::repo_add(easy = "https://easystats.r-universe.dev")
❯ pak::repo_get()
# A tibble: 6 x 5
name url type r_version bioc_version
<chr> <chr> <chr> <chr> <chr>
1 CRAN https://cloud.r-project.org cran * NA
2 easy https://easystats.r-universe.dev cranl… * NA
3 BioCsoft https://bioconductor.org/packages/3… bioc 4.1.0 3.13
4 BioCann https://bioconductor.org/packages/3… bioc 4.1.0 3.13
5 BioCexp https://bioconductor.org/packages/3… bioc 4.1.0 3.13
6 BioCworkfl… https://bioconductor.org/packages/3… bioc 4.1.0 3.13 ❯ pak::meta_list("correlation")
# A tibble: 4 x 32
package version depends suggests license imports linkingto archs enhances
<chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
1 correla… 0.6.1 R (>= … "BayesFac… GPL-3 "bayeste… NA NA NA
2 correla… 0.6.1 R (>= … "BayesFac… GPL-3 "bayeste… NA NA NA
3 correla… 0.6.2 R (>= … "BayesFac… GPL-3 "bayeste… NA NA NA
4 correla… 0.6.2 R (>= … "BayesFac… GPL-3 "bayeste… NA NA NA
# … with 23 more variables: os_type <chr>, priority <chr>,
# license_restricts_use <chr>, license_is_foss <chr>, repodir <chr>,
# platform <chr>, rversion <chr>, needscompilation <chr>, ref <chr>,
# type <chr>, direct <lgl>, status <chr>, target <chr>, mirror <chr>,
# sources <list>, filesize <int>, sha256 <chr>, sysreqs <chr>, built <chr>,
# published <dttm>, deps <list>, md5sum <chr>, path <chr> ❯ pak::pkg_install('correlation')
✔ Updated metadata database: 1.11 MB in 3 files.
✔ Updating metadata database
→ Will install 5 packages.
→ Will download 3 CRAN packages (5.14 MB), cached: 2 (0 B).
+ bayestestR 0.10.0 ⬇ (3.29 MB)
+ correlation 0.6.2
+ datawizard 0.1.0 ⬇ (269.33 kB)
+ insight 0.14.2
+ parameters 0.14.0 ⬇ (1.57 MB)
ℹ Getting 3 pkgs (5.14 MB), 2 cached
✔ Got datawizard 0.1.0 (macos) (269.33 kB)
✔ Got parameters 0.14.0 (macos) (1.57 MB)
✔ Got insight 0.14.2 (macos) (1.74 MB)
✔ Got bayestestR 0.10.0 (macos) (3.29 MB)
✔ Got correlation 0.6.2 (macos) (3.69 MB)
✔ Downloaded 5 packages (10.57 MB)in 2.5s
✔ Installed datawizard 0.1.0 (115ms)
✔ Installed bayestestR 0.10.0 (234ms)
✔ Installed insight 0.14.2 (289ms)
✔ Installed parameters 0.14.0 (325ms)
✔ Installed correlation 0.6.2 (268ms)
✔ 1 + 4 pkgs | kept 0, updated 0, new 5 | downloaded 5 (10.57 MB) 14.1s |
I'm aware of that. My point is that this is a more confusing operation for a one-off package installation: pak::repo_add(easy = "https://easystats.r-universe.dev")
pak::pkg_install("correlation") than: pak::pkg_install("correlation", repos = "https://easystats.r-universe.dev") Given the increasing prevalence of instructions like this (including in the pak readme): install.packages("correlation", repos = "https://easystats.r-universe.dev") it would help to eliminate friction if pak::pkg_install("correlation", repos = "https://easystats.r-universe.dev") A big part of my thinking there is that pak is becoming a much smoother approach to installation, and I am considering incorporating it into teaching to new R users as a unified way to install packages. Being able to say "if you're following instructions somewhere, you can replace either install.packages() or remotes::install_github() with pak::pkg_install() to take advantage of pak's headache-removing features" would be really useful. |
I do not want to add many parameters to Also, I expect that people copy-paste installation instructions from the README, so I don't think it matters if it is one line or two.
That will only work in the simplest cases, because Btw. install.packages(..., repos = "https://....r-universe.dev") only works if the r-universe repo is self-contained, because it omits CRAN from your repos. So in reality you would need something like install.packages(
...,
repos = c(
runiverse = "https://....r-universe.dev",
CRAN = "https://cloud.r-project.org"
)
) This also gets more complicated if you have configured Bioconductor or other repos. |
With base
install.packages()
, it's possible to specify additional repos to search in addition to the ones listed inoptions("repos")
with therepos
argument:This is convenient, and I've found also easier to explain to my students and users of my packages. It would be nice to be able to do similarly with
pkg_install()
to add an extra repo to the list at function runtime:The text was updated successfully, but these errors were encountered: