There is an R option for repos
.
When installing a package you can provide a repos
param, and I assumed it overrides getOption("repos")
. But from testing, it seems that's not true.
For example:
options(repos=c(CRAN="https://BADNAME.com"))
install.packages("vctrs", repos = "https://cloud.R-project.org")
With this code, I would assume that the BADNAME repo would be completely ignored because I explicitly provided a repos argument. But after running this code, I learned this is not the case.
To me that feels like a bug. The repos
argument intuitively means that it would be what's used, it should override environment settings. Why is this not the case?