r-lib / pak

A fresh approach to package installation
https://pak.r-lib.org
671 stars 60 forks source link

Detect and use conda/mamba #531

Closed gdevenyi closed 1 year ago

gdevenyi commented 1 year ago

A much more useful feature than the apt-get helper in #530 would be to detect and use conda/mamba to install available packages when R is running from a conda environment.

Currently, I have to manually run this script:

#!/usr/bin/env Rscript
library(pkgdepends)
args = commandArgs(trailingOnly=TRUE)
prop <- pkgdepends::new_pkg_installation_proposal(
  args[1], 
  config = list(dependencies = TRUE)
)
prop$solve()
prop$show_solution()

To list all the packages I need, then go and try to find the conda versions and install them manually.

gaborcsardi commented 1 year ago

I am fairly sure that we are not going to implement that, conda already supports installing R packages together with their system requirements AFAIK.

But if you want to look up the system requirements with pak, you can do that with pkg_sysreqs().

OTOH pak should probably turn off system requirements installation by default if conda is active.