Upgrade the R version

Hi Everyone - I would like to upgrade the R version from 3.4.2 to 3.5.0.We are using CENT OS 7

  1. Could you please share the command to upgrade it to 3.5.0
  2. Is the R Studio restart required ?
  3. Is all existing packages will work after we upgrade to 3.5.0 ? or Do i need to upgrade it ?

Currently nearly 40+ people will be using R Studio in my company.

Can some one please help me how to achieve this. I appreciate your help !

To answer this one piece, yes you will need to reinstall all of the packages. This is because the 3.5 upgrade has different internals from the previous versions, so all packages will need to be recompiled.

How do we list out the existing packages from command line using Linux ? so that I can re install all of them after upgrade.

if you're only worried about CRAN packages you can use this solution:

Note that it will not be able to install packages installed from locations other than CRAN (i.e. github).

1 Like

This is a fantastic question. Do you mind clarifying how RStudio is being used? Is this RStudio Server Pro?

If so, the general recommendation is not to upgrade R (for the problematic reasons of installing packages / breaking content / etc. as @mara mentioned). Rather, we recommend installing multiple versions of R side-by-side, and RStudio Server Pro allows users to decide which version of R they want to use for a given project.

For instance, a legacy project may keep running on R 3.4.2, where a new project may start on R 3.5.0 . The other option, if you do want everyone to migrate to R 3.5.0, is giving them the ability to slowly transition their work over a specified time-frame (rather than everything breaking on upgrade) before removing the old version of R. More on these varied approaches is written here.

There is more about this paradigm in the following RViews article:

Also, although it is for a different professional product, the RStudio Connect Administrator guide has some additional directions on how to build R from source, which enables having multiple versions installed side-by-side.

If you are not using RStudio Server Pro, you can still follow the build-from-source approach. However, only a single version of R can be used with RStudio at a given time. As a result, there will likely be a good bit more expedience necessary in migrating content immediately to the new version.

If you are using RStudio Server Pro, then you should have a selector like the following that allows you to select which version of R you want to use for a given project. It is possible for the admin to set defaults and specify which versions are available:
image

For those more interested in why R packages are generally not portable across different versions of R, this RPubs article is an interesting read.

5 Likes

Currently we are using RStudio Server Pro.I can build different versions of R by using yum-builddep R command,after that I will lost all the existing packages ? Almost 40 people using R studio IDE in my organization. Do i need to reinstall it again or how the packages will be compatible with different versions of R.

In short, yes. I believe the release structure of R is such that changing major release versions (3.4.x to 3.5.x) requires reinstalling packages. Depending how your environment is setup, this may need to occur for EACH user as the default install location is in /home. If you have restrictions on directory sizes, keep an eye on /home as when it fills to 100%, everything will break.

Cole’s approach is what we did and it’s the best approach. It allows users to use multiple versions in parallel and helps with migration.

Final note - I would strongly recommend you do not use system versions of R installed through yum. We had all sorts of problems due to this when attempting to install multiple versions in /opt/R. There’s a painful thread here where you can follow our struggles.

2 Likes

After reinstall all the packages, Is it compatible to all the versions of R ?

Again, I believe that packages are minor release dependent. The release version convention is:

major.minor.subminor.

So if you installed versions 3.4.1, 3.4.2, and 3.4.3, there would be one library folder created for 3.4. If your users installed packages for 3.4.1, they would be compatible with 3.4.3.

For minor releases like 3.5.0, a new library folder would be created and the user would have to reinstall all of their packages. But it would remain compatible for all subminor releases within major release 3.5.

2 Likes

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