Apr 17, 2012 Install R, RStudio, and R Commander in Windows and OS X. R is an incredibly powerful open source program for statistics and graphics. It can run on pretty much any computer and has a very active and friendly support community online. You can also choose Zip/Tarballs (except folks with Mac OS). This will put RStudio in a folder from which you can run RStudio, but won't actually “install” the.
Using Vagrant
This page is intended to help you configure your own machine for RStudio development. If you'd prefer an isolated development environment in a preconfigured virtual machine, you can use our Vagrant configuration script to create one (see RStudio Development for details).
Windows Bootstrapper
On a clean Windows-10 system, you can bootstrap RStudio development by following the instructions here. Otherwise, configure manually per the following instructions.
Installing R
On all platforms you need to install a version of R to target development against; you should install R before running any dependency installation scripts in RStudio.
RStudio itself is compatible with R version 3.0.1 or later, but version 3.1 or greater is recommended for development installations. The following are links to the installers for current, older, and development versions of R for all supported platforms.
Linux (Source)
A version of R exists in the package repository for most major versions of Linux, but it's usually very outdated, so we recommend installing R binaries from CRAN instead.
Ubuntu Quickstart
If you're building an Ubuntu dev box, here's the tl;dr for getting R installed on Trusty (Ubuntu 14):
For Ubuntu 18:
R for macOS
R for Windows
Make sure to install R to
C:R
, not C:Program FilesR
as is the default, since RStudio's build process needs to write additional symbol information into R's installation directory, and will not have permission to write to Program Files.Additional Dependencies (Linux)
gcc version
It is recommended that you build RStudio with GCC 4.8 or above. For Pro builds, this is required.
Also, on some platforms you must manually select and install an OpenJDK-8. Some of the dependency scripts mentioned below have been updated to install this for you, others have not. Please check the script to see if there is an openjdk reference in it.
Install Linux Dependencies
On Linux all dependencies can be installed installed using the scripts in:
There is a separate script for systems with debian, yum, or zypper based package management. For example, to install dependencies for debian systems:
Additional Dependencies (macOS)
C/C++ Tools
The C/C++ development tools required RStudio development can be obtained by installing the Command Line Tools for XCode. You can do this one of two ways. Either:
- Download and install XCode from the Mac AppStore: http://itunes.apple.com/us/app/xcode/id497799835?mt=12
- From a terminal, execute:
Or alternatively (for a smaller download size):
- Register as an Apple Developer (free) here: https://developer.apple.com/programs/register/
- Download the Command Line Tools for Xcode appropriate for the version of OS X you are running from here: https://developer.apple.com/downloads/
Other Dependencies
You should install the latest version of CMake from here:
Finally, you can install the remaining dependencies (including the Boost C++ libraries and Qt) using the script at:
You should switch to this directory and then execute:
OpenSSL
If you're on OS X El Capitan (10.11) or newer, you'll also need to install the OpenSSL development headers, as these have been removed in recent versions of OS X. If you have Homebrew, you can install them like this:
or you can compile OpenSSL yourself.
Java Tools
In order to build the RStudio client GWT code, you need a JDK as well as the Ant build tool. You can install Java 8 from the following URL (note that Java 9 and 10 are currently unsupported):
Next, you can install Ant from one of the following URLs:
![Install Install](http://rprogramming.net/wp-content/uploads/2012/10/RStudio-Screenshot.png)
Additional Dependencies (Windows)
R
On Windows, prefer installing R into a location where your user account has write permissions (e.g.
C:RR-x.y.z
). This is necessary as RStudio will generate export libraries for the MinGW DLLs used by RStudio, so that the libraries can be consumed by MSVC. If you are not sure, reinstalling R under C:R
will save some configuration time later on.You will also want to be sure that the R executable is in your system or user
%PATH%
, such that typing R
in cmd.exe
starts the R interpreter. This is required by several RStudio dependency installation scripts.Qt SDK
Currently, we build against Qt 5.12.1 -- you can download this from the Qt website at:
You should download and install this to the default location on your system (
C:/Qt
). The following components must be included to build RStudio on Windows:- MSVC 2017 32-bit
- MSVC 2017 64-bit
- Qt WebEngine (for both components)
Microsoft Build Tools
RStudio uses
Microsoft Build Tools 2017
for compilation on Windows. These can be downloaded here: https://www.visualstudio.com/vs/older-downloads/. Install these tools to the default location. If you're using Qt Creator during development, it should automatically detect this as a 'kit' to use with RStudio.CMake
You should install the latest version of CMake from here: CMake Download
NOTE: You should choose the 'Add to system path' option during the installation.
Java Tools
In order to build the RStudio client GWT code, you need a JDK as well as the Ant build tool. You can install Java 8 from the following URL (note that Java 9 and 10 are currently unsupported):
Next, you can install Ant from one of the following URLs:
Installer Tools
If you want to build RStudio installers for Windows, you should also install the Nullsoft Installer System (NSIS) from here: http://nsis.sourceforge.net
Other Dependencies
You can install the remaining dependencies (including the Boost C++ libraries) using the script at:
You should switch to this directory and then execute:
Updating the System Path
Building RStudio requires that the CMake, and Qt beaccessible via the system path (note that CMake should already be accessiblevia the CMake installer if the 'Add to system path' option was chosen duringinstallation). For Qt, you should ensure that the followingadditional directories are available on the path:
Finally, you should also ensure that your R installation's bin directory is on the system path. For example:
Building from Qt Creator
- Open Qt Creator,
Projects
thenManage Kits
. - Make sure the
MSVC 2017
kit is the default. - If you didn't install R at the recommended location (
C:R
), you will need to manually run the script that generates MSVC compatible export libraries for each of the R dlls. Follow the instructions below to do so:- Open a terminal as administrator
- Navigate to the RStudio repo base folder
- Run the following command:
<Path to R installation>binx64Rscript.exe srccpptoolsdll2lib.R
- The path to your R installation will change depending on what version of R you installed and what settings you chose at install time. (e.g.
C:Program FilesRR-3.4.4
)
- The path to your R installation will change depending on what version of R you installed and what settings you chose at install time. (e.g.
- Repeat this for
x86
by running the following command:<Path to R installation>binx86Rscript.exe srccpptoolsdll2lib.R
Windows SDK
To make sure
rstudio.bat
runs correctly, install the latest version of Windows SDK from https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk, you might need to uninstall the installed version first, make sure at least the following options are selected:Miscellaneous
- On launching
rstudio.exe
, you may be met with a blank screen. If this happens, first launchrstudio.exe
by CTRL-clicking on it, and then select a 32-bit flavor of R. After this, the invocationdesktoprstudio.exe
should successfully launch RStudio. - RStudio uses git during the build + install phases with
cmake
. On Windows, you can use the the Git installer provided here -- after installing to the default location, you can putC:Program FilesGitcmd
on thePATH
(notC:Program FilesGitbin
)