3

I more or less follow this guideline:

  1. Run installr::updater() from ../R-4.0.0/bin/x64/Rgui.exe (as suggested if you run it from RStudio)
  2. Update all packages (check the "update all packages" box from installr::updater())
  3. Change Windows system environment variable R_LIBS in my case to ..\R\R-4.0.x\library.

If I want to switch the R vesion from RStudio, I need to

  1. Set Tools -> Global Options -> General -> R version AND
  2. change R_LIBS to the correct place. (If you forget this, .libPaths() has more than one entry.)

So my questions are:

  • Is that process correct? Do I miss anything?
  • What about changing Rtools when switching between major R-versions, see e.g. here?
  • It seems installr::updater() does not update the packages, although I check the "update all packages" box. (We observed that behaviour on two different laptops.)
  • It seems, .Rprofile, .Renviron, and Rprofile.site play a crucial role, see RStudio. Last time, everything worked fine, .Rprofile and .Renviron were empty and I had to add the line .libPaths("path2/R-4.0.4/library") to Rprofile.site. It seems you can use usethis::edit_r_profile() to finde those files.

Background: I had this question which was reproducible before I upgraded R to 4.0.2, but I realized, that after switching between R 3.5.1, 4.0.0 and 4.0.2 back and forth for testing it is not reproducible anymore. Thus I think, that my update-process was error-prone.

Christoph
  • 6,841
  • 4
  • 37
  • 89

1 Answers1

0

Two years later, I more or less follow this process with success:
(Windows: Make sure R and RStudio are located C:\. Otherwise you run in trouble with .libPaths()!)

  1. Run installr::updater() from C:/R-4.x.y/bin/x64/Rgui.exe (as suggested if you run it from RStudio)
  2. Update Windows PATH variables
  3. Update all packages (check the "update all packages" box from installr::updater())
  4. Keep packages at the old R-version if you like

If you follow this process, R_LIBS, .Rprofile, and .Renviron should have no impact (it seems).

Christoph
  • 6,841
  • 4
  • 37
  • 89