CRAN repositories modified outside package preferences

On Windows, RStudio seems to use Microsoft's R Client / R Open (not really familiar with it) by default, which uses CRAN snapshots of specific dates to ensure reproducibility.

To compile a bookdown document, I need newer versions of some packages.



indicates the older snapshot of the CRAN repository ("2016") used by Microsoft's R installation, which I therefore wanted to change.
However, changing it with the dialog available via "Tools > Global options... > Packages" has no effect.
The dialog "Tools > Global options... > Packages" tells me "CRAN repositories modified outside package preferences".

I'm using RStudio 1.2.1335 on Windows 10 (not really my favourite platform - on Linux everything works fine).

Is anyone familiar with pointing Microsoft's R client to a newer snapshot or the current CRAN server?
On, Microsoft gives some information, but the suggested options(repos = c(CRAN = "")) (adapted YYYY-MM-DD) did cause update.packages() to update packages.

First, RStudio does not ship with R and use any of your R version you have installed and tells it to use. By default, it is your default R version on your system.
It seems you have Microsoft R client installed for RStudio to use.
You can change that by installing a new R version for CRAN and pointing RStudio to use it.

Changing it this way is the correct way. You can even point to a non MRAN repo like

options(repos = c(CRAN = ""))

Then your default repos will be this new one you change it too so yes, running update.packages will update the package.
You can install only the package you want to update by reinstalling them one by one.

to update a subset of packages, I think this is like that

update.packages(oldPkgs = c("bookdown", "rmarkdown"))

as explained in ?update.packages

What did you try after changing the repos to a new MRAN snapshot ?
What is the issue ?


Thanks a lot for your answer, which helped me a lot.

Pointing to a non MRAN repository with

options(repos = c(CRAN = ""))

was what finally solved the issue for me.
I hope this well be of help for other people with a similar question.

What could also be helpful for other users:
It is also possible to install the official R version and point RStudio to use it.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.