RStudio provides pre-compiled binary installers for multiple versions of R across different operating systems. Follow these instructions.
Building Additional Versions from Source
In some cases, it may be necessary to compile R from source. For example, you may need to compile R from source if you are using a custom Linux distribution.
First, ensure that you have the build dependencies required for R. On RedHat/CentOS you’d use this command:
$ sudo yum-builddep R
On Debian/Ubuntu systems you’d use this command:
$ sudo apt-get build-dep r-base
Configuring and Building R
Once you’ve satisfied the build dependencies, you should obtain and unarchive the source tarball for the version of R you want to install. As an example, one mirror you can download R 3.X source from is: https://cran.rstudio.com/src/base/R-3/
Once the source is downloaded, from within the extracted source directory, execute these commands (this example assumes you are installing R 3.3.0):
$ sudo ./configure --prefix=/opt/R/3.3.0 --enable-R-shlib $ sudo make $ sudo make install
Note that the
--enable-R-shlib option is required in order to make the underlying R shared library available to RStudio Workbench or RStudio Server.
Using the System BLAS Libraries
You may also wish to link to the system BLAS libraries rather than use the R internal versions. For this you’d use the following configure command:
sudo ./configure --prefix=/opt/R/3.3.0 --enable-R-shlib --with-blas --with-lapack
Recommended Installation Directories
Open-Source RStudio Server
In the Open-Source RStudio Server, RStudio uses the version of R pointed to by the output of the
which R command. If RStudio is unable to locate R using
which R, it will fall back to scanning explicitly for the R script in the
/usr/bin directories. For more on this, see our article on using different versions of R here.
RStudio Workbench (previously RStudio Server Pro)
As of v0.99.715, RStudio Workbench (previously RStudio Server Pro) automatically scans for versions of R at the following locations:
/usr/lib/R /usr/lib64/R /usr/local/lib/R /usr/local/lib64/R /opt/local/lib/R /opt/local/lib64/R
In addition, RStudio Workbench scans all subdirectories of the following directories within
For example, any of the following installed versions of R will be automatically detected by RStudio Workbench:
If you have versions of R located at other places in the file system RStudio Workbench can still utilize them however you’ll need to explicitly specify their location in a configuration file. For more information, see Chapter 6: R Versions of the RStudio Workbench Admin Guide.
Note: Version 3.3.0 is the minimum supported R version for Workbench.