An Introduction to R and RStudio

Download and Installation

RStudio is available for Windows, Linux and Mac OS X (10.5+). The software can be downloaded from http://rstudio.org/download/desktop. This page will attempt to determine the best download for your system, but you may also choose from the list below.

Like R, there are precompiled binary install files available for most popular OS. If yours is not listed, and none of the binaries work, then you should download the source code and compile RStudio on your system.

There is also a nice option to download a zip/tarball version of RStudio. This version doesn’t require installation, so if you plan to use it on a system where you don’t have admin/root privileges this is the one you want to download. This version is also ideal to install on USB data sticks – giving you a portable version that you can travel with.fn8

Note: RStudio is still in beta, thus you may come across an error or two. However updates are released frequently and the community are only too happy to help out. I have been running RStudio on Windows XP/7/Server 2008, Ubuntu and Debian with zero issues as yet. Current stable version is v0.96.331 – as of the 1st Oct 2012.

Using different versions of R within RStudio

If you recall from the previous section I mentioned development versions of R. By nature these releases aren’t fully stable and thus the majority of users will stay away from them. However sometimes a development build is required by certain packages you will use. But what if you don’t want to uninstall your current stable version of R? Well you don’t have to. You can have multiple versions of R installed on the same systemfn9, and just use the version you require each session.

RStudio allows you to work with different versions of R as well. To start RStudio with a specific version all you need to do is hold down Ctrl while starting RStudio (double clicking the executable – again I’ve tested this in Windows and Linux, can’t speak for Mac). This will open a small window where you can choose which installed R version you’d like to run inside RStudio.

Customisation Options

You can access RStudio options from the Tools | Options menu which includes the following sections:

General R Options – default CRAN mirror, initial working directory, workspace and history behaviour. Source Code Editing – enable/disable line numbers, selected word and line highlighting, soft-wrapping for R files, parenthesis matching, right margin display, and console syntax highlighting; configure tab spacing, set default text encoding. Appearance and Themes – specify font size and visual theme for the console and source editor. Pane Layout – locations of console, source editor, and tab panes; set which tabs are included in each pane.


fn8. R can also be installed to a USB drive, so you can have a completely portable analysis system at all times.
fn9. Install each version as you would normally (see instructions in the previous section).