Normally I install R packages with:
install.packages("my_package", repos = "https://cloud.r-project.org")
Is it possible to specify a CRAN mirror with an environment variable
export CRAN_URL="https://cloud.r-project.org"
such that I can call install.packages
without repo
? e.g.,
install.packages("my_package")
I am open to using pak
, as well.
I am aware i can modify my .Rprofile, but I want a solution that is more portable (executable on multiple machines i might login to, where env variables are defined).
I found something about R_CRAN_WEB
and R_CRAN_SRC
, but setting these doesn't seem to change anything for me.
I apologize if this has already been answered. This seems like a basic question, but I can't find an answer in the following questions: