In this article, you will learn to install R software and R Studio to get started with R programming.
The R software is a free software which you can install to write your programs and R-Studio is an IDE that helps to manage your workspace (you will learn about workspace later) and debugging, syntax highlighting, etc.
To learn R you don’t need R-Studio, however, we recommend installing it because it will make things little easier. Also, throughout this tutorial, we have used R-Studio for R programming examples.
In the next few sections, you will learn how to install R and R-Studio. If you already familiar with the step, simply skip this part and move to next article.
Download R and R-Studio
The first step to install R is download the required software from the following links.
Before downloading the software check the system requirements such as disk space, Windows operating system 10/8/7/XP and 32/64 bit system. The best way to know this in advance is to read the product documentation for R and R-studio.
Installing R
Once you have downloaded the R and R-studio in a separate folder and click R-3.x.x to start installing it. See the figure below.
Click run
to continue the installation.
The R setup will ask you to select the language. If you want a different language other than English, click the drop down and select your language.
Click OK
to continue with he installation.
In the next screen, you will be asked to accept the license agreement. R software is free with GNU license means you do not need to pay for anything.
Click Next
to continue with the installation of R.
Next step is to choose a installation directory for R. By default, R tries to install in C:/Program Files/R/R-3.x.x
, however, you can click on the Browse
button and navigate to a location of your choice.
Make sure that the destination drive has enough disk space.
Choose a different directory using Browse
or click Next
to continue with the installation.
Now, in the next screen, you have to select the required components
that you want to install for R. If you have a 64 bit system you can select 32 bit files or 64 bit files
. Otherwise, for 32 bit system only select 32 bit files
.
Since, we are using a 64-bit Windows 8.1 system, 32-bit files
are not selected for this installation. You can select rest of the components to install. Click Next
to continue the installation.
The next screen is about startup options. R provides with two startup options.
- customized startup environment
- default startup
In a fresh installation, a site-wide environment or user specific environment configuration file does not exist.
If available, this file will be located in the installation directory (C:/program files/R/..).
The file is called Rprofile.site
, if not than R will try to start the environment from current working directory. A working directory
is directory where R command line works. It means whatever R command you give to console is executed here.
If nothing is found site-wide , then R tries to load the environment from user-home directory. It look for a file called .rprofile.
Select No, if you are not using RProfile.site
or any .rprofile
configuration. Click Next
to continue with the installation.
In the next screen, select if you want R to be in the Start Menu folder. if not, then select ”Don’t create a Start Menu folder” and click Next
.Otherwise, simply click Next
to continue.
You can select to create shortcuts for R on desktop here or a quick launch shortcut in windows taskbar. Since, we are going to use R-Studio, no need to select quick launch shortcuts.
Data from R workspace is stored in .RData files
. You choose the registry
options. Click Next
to continue.
You have to wait for few minutes while setup installs R on your computer.
Once the setup completes the installation of R, you can click Finish
.
Installing R-Studio
R-Studio is an Integrated Development Environment (IDE). It highlights the R syntax, help in debugging R codes, and so on.
You have already downloaded the R studio and saved it in the same directory as R.
Click the setup for R-studio
and start the installation.
First right-click the RStudio
setup and select Run As Administrator
.
Click on the RStudio
setup and click Next
.
Choose the installation directory, by default, it will install it in the C:/Program files/RStudio
. However, you can change the installation directory by clicking the Browse
button.
Click Next
to continue with the installation.
The setup will continue to install the files which will take few minutes.
Once the setup is complete the installation click on Finish
.
Congratulations ! you have installed R and RStudio successfully. Try to open the RStudio and verify your installation.