A solid foundation for R
Administering R on the desktop is relatively easy, because desktops are designed for a single user at a specific time. Desktop users upgrade R versions and R packages as new software becomes available, leaving old versions and packages behind. Servers, on the other hand, are designed to support multiple people who want to access content across time. Servers are increasingly used for building data science labs in R, deploying R in production, and running R in the cloud. You may find that the same strategies you use to administer R on your desktop do not work as well on a server. In particular, upgrading your version of R must be handled differently.
If you upgrade R on your server as you do on your desktop, you could easily break some apps and disrupt your teams. Administrators should exercise caution when upgrading to a new version of R on a Linux server. Consider the following situations:
- You are hosting apps on RStudio Connect and Shiny Server for more than a year. When you upgrade R, you break many of your older apps.
- Your team is developing code on a shared instance of RStudio Server. When you upgrade R, you disrupt people’s work and break their code.
Instead of upgrading your existing version of R, a better solution to these problems is to run multiple versions of R side by side. This strategy preserves past versions of R so you can manage upgrades and keep your code, apps, and reports stable over time.
Do not use your linux package manager to to install R
To get multiple versions of R side-by-side, it's important that you do not use your linux package manager to install R. For example, do not use yum (on Red Hat / CentOS) or apt (Debian or Ubuntu).
When you install R from these package repositories, you will overwrite your existing R version, and your old version of R will no longer be available.
Installing R from pre-compiled binaries (recommended)
To get multiple versions of R side-by-side, you have two options:
- Compile and build R from source code
- Install R from pre-compiled binaries for your platform
Building R from source provides you with two benefits:
- You can specify the installation folder
- You have maximum flexibility to specify the exact configuration
However, building R from source is somewhat time-consuming, and could take several minutes every time you install R.
For this reason, RStudio provides pre-compiled binary downloads of R for variety of Linux platforms.
To install R from a pre-compiled binary, follow the instructions at Install R.
Building R from source
The best way to run multiple versions of R side by side is to build R from source. If you are running R on a Linux server – and particularly in the enterprise – you should always build R from source, because it will help you:
- Run multiple versions of R side by side
- Guarantee that R will work on your unique server configuration
- Potentially speed up certain low-level computations used by R
- Build technical expertise that will help you administer R at scale
Most enterprise IT departments will be comfortable building software from source.
If you want to install R from source, follow the instructions at Install R from Source.
RStudio professional products
RStudio professional products automatically support multiple versions of R and provide additional features, such as having administrators control access to multiple versions, or allowing users to choose for themselves. RStudio Connect automatically provides R version matching. Running multiple versions of R side by side with RStudio Connect will ensure that your content remains stable over time.