简体   繁体   中英

install.packages() enforce no CRAN mirror selection?

When running install.packages("somepackage") from terminal, the pop out gui to select a CRAN mirror can be inconvenient and somewhat unnecessary.

Is there a way to call install.packages("somepackage") (from R in the terminal) so as to avoid having to select a mirror via the gui, but doesn't require naming a specific mirror address/mirror ?

install.packages("names", repos = "https://cloud.r-project.org")

You could also set the mirror you want with :

options(repos=structure(c(CRAN="getCRANmirrors()$URL[1]")))

in a .Rprofile file so your R will automatically use this repos when you will call :

install.packages() .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM