RStudio Workbench (previously RStudio Server Pro) gives you the ability to select multiple versions of R from within the IDE. Access to multiple versions of R can be useful for the following tasks:
- Manage upgrades of R
- Test code on a variety of R versions and distributions
- Support projects that depend on various versions of R
Installing Multiple Versions of R
The most common way of installing R is downloading binary versions from a standard repository. You may have also obtained binary versions of R from a vendor.
To install multiple versions of open-source R side-by-side you will typically need to compile and build R from source. See this article for more.
RStudio Workbench will scan a specific set of directories to find all versions of R currently installed on the system. If you have installed versions of R in alternate locations you can add them to the r-versions configuration file.
Using Multiple Versions of R
You can select different versions of R by selecting it from the drop down list at the top of the browser window.
The drop down menu will allow you to select the version of R you want to use. When you switch versions, the system will ask if you want to save your workspace before restarting your session.
You can also control the default version of R for new sessions by changing the global options (under Tools -> Global Options). New sessions will automatically be set to the selected version of R.
In most cases projects will be associated with only one version of R. By default, new sessions in projects will be restored to the last used R version. If you want to disable this feature uncheck "Restore last used R version for projects" in the global options.
Administrators can also configure the way users and groups access multiple versions of R. They can set a default version per user and per group. They can also exclude versions or disable using multiple versions entirely. These settings are managed in the rserver.conf file.
Administrators can also handle upgrades to new versions R in various ways. By setting defaults for users and groups, administrators can impose a full migration, a partial migration, or allow users to migrate themselves. For more information, see Chapter 6: R Versions of the RStudio Workbench Admin Guide.