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 https://mran.microsoft.com/faq#change-repos, Microsoft gives some information, but the suggested options(repos = c(CRAN = "https://mran.revolutionanalytics.com/snapshot/YYYY-MM-DD")) (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
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