Additional course material

How to install R and RStudio

To see the original context version, see here from the R-studio education project

To get started with R, you need to acquire your copy. This appendix shows you how to download R and RStudio, a software application that makes R easier to use. You’ll go from downloading R to opening your first R session.

Both R and RStudio are free and easy to download.

How to Download and Install R

R is maintained by an international team of developers who make the language available through the web page of The Comprehensive R Archive Network. The top of the web page provides three links for downloading R. Follow the link that describes your operating system: Windows, Mac, or Linux.

Windows

To install R on Windows, click the “Download R for Windows” link. Then click the “base” link. Next, click the first link at the top of the new page. This link should say something like “Download R 3.0.3 for Windows,” except 3.0.3 will be replaced by the most current version of R. The link downloads an installer program, which installs the most up-to-date version of R for Windows. Run this program and step through the installation wizard that appears. The wizard will install R into your program files folders and place a shortcut in your Start menu. You will need all the appropriate administration privileges to install new software on your machine.

Mac

To install R on a Mac, click the “Download R for Mac” link. Next, click on the R-3.0.3 package link (or the package link for the most current R release). An installer will download to guide you through the installation process, which is very easy. The installer lets you customize your installation, but the defaults will suit most users. I’ve never found a reason to change them. If your computer requires a password before installing new programs, you’ll need it here.

Linux

R comes preinstalled on many Linux systems, but you’ll want the newest version of R if yours is out of date. The CRAN website provides files to build R from source on Debian, Red Hat, SUSE, and Ubuntu systems under the link “Download R for Linux.” Click the link and then follow the directory trail to the version of Linux you wish to install. The exact installation procedure will vary depending on the Linux system you use. CRAN guides the process by grouping each set of source files with documentation or README files that explain how to install them on your system.

The download pages on CRAN’s website provide information about building R from source for the Windows, Mac, and Linux platforms.

How to install R and RStudio

RStudio is an application like Microsoft Word—except that instead of helping you write in English, RStudio helps you write in R. I use RStudio throughout the workshop because it makes using R much easier. Also, the RStudio interface looks the same for Windows, macOS, and Linux.

You can download RStudio for free. Just click the “Download RStudio” button and follow the simple instructions. Once you’ve installed RStudio, you can open it like any other program on your computer—usually by clicking an icon on your desktop.

How to identify if you are in R or RStudio