update R

Updating R can be a nightmare. And it happens much too often. The base R part is not so much an issue, it’s more updating all the packages as the right way to reinstall is not necessarily well documented.

The way I do it? (It also works for reinstalling everything on a brand new Ubuntu)

  1. copy all packages folders from last version folder to new version folder, ex:
    cp ~/R/x86_64-pc-linux-gnu-library/3.4 ~/R/x86_64-pc-linux-gnu-library/3.5
  2. update all the installed packages (it’s smart enough to do it only if needed)
    update.packages(checkBuilt = TRUE, ask = FALSE)
  3. check error messages in the above they will tell you what needs to be done on the “apt” side

Comments are closed.