posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.82k stars 91 forks source link

R: Provide a way to set the default CRAN repositories #5318

Open jmcphers opened 1 week ago

jmcphers commented 1 week ago

The R kernel always sets cran.rstudio.com as the default CRAN mirror. This logic lives here:

https://github.com/posit-dev/ark/blob/4e37e46787ccf7c6a6142e705465580e87f3f0c5/crates/ark/src/modules/positron/options.R#L29-L44

It is possible to change the mirror interactively via R's options() command, but difficult to do so in a way that is durable across R versions and environments, especially for server administrators.

We should make it possible for the repositories to be set via an external mechanism, so that a hosting environment can tell the R kernel which CRAN mirror(s) to use by default. This is important in many organizations for performance reasons (e.g. using pre-built binaries) as well as security and compliance (e.g. using only approved/validated R packages).

Implementation notes:

jmcphers commented 1 week ago

Triage: