Introduction to Installing R
In this article, we are going to learn about how to Install R. R is one of the most commonly used statistics software that comes for free in the market. It is the most commonly used open-source statistical analysis tool that is available in the market. It supports analysis as a simple programming or an interactive mode.
Prerequisites of Installing R
R program needs to be installed on the computer to be used.
Verify R is already installed on the windows machine:
Prior to installing R on the machine, the first thing to do is to verify whether it is already installed on the computer. Below are the steps to verify whether it is installed in the machine or not:
- Verify whether the R icon is available on the desktop of the computer. If so, R is already installed in the machine and can be run by double-clicking on the icon.
- Verify if the R icon is available in the start menu. It can be selected by first clicking to the start menu of the windows desktop then the all programs menu and it will pop up a list where R icon will appear. It can be run by selecting the icon.
If either of the above steps has not succeeded in starting the R program, it indicates that R is not installed on the system and it has to be installed for use.
The next task is finding out the latest version of the R program. The CRAN or comprehensive R network website list all the version of the R, where the desired version can be selected. There is also an option to get the latest release which can also be leveraged in case one is not aware of which version to use.
R has been releasing new versions regularly and it is being actively improved over time. It is always recommendable installing the latest version regularly to ensure compatibility with all the R packages that have been downloaded.
Steps for Installing R on windows
Below are the steps for installing on a Windows machine:
Step 1: Browse the below website to get the latest R version. Website – http://ftp.heanet.ie/mirrors/cran.r-project.org/
Step 2: There will be a download and install R option where we need to click the windows link.
Step 3: From the list of the sub-directories we need to select the base link.
Step 4: The next page will show a link showing something like R 2.10.1 for Windows. The x.x.x denotes the version of R. Select the link to proceed further.
Step 5: There will be an option to select whether we want to save or run the file R-2.10.1- win 32.exe. First, we have to save the file on the path where we wish. Next double click on the icon of the file to run the setup.
Step 6: On being asked about what language to choose please choose English.
Step 7: The setup wizard will appear in a window where we need to choose next to proceed with the setup.
Step 8: The next page on the wizard will show information on the top.
Step 9: Please click next to continue with the setup.
Step 10: The following page will ask to select the destination location where we want to install R. By default the location will be the program files folder in the C drive on the system. Location- c:\program files
Step 11: After that click next.
Step 12: The following page will ask to select components on the top. Click next to continue with the setup.
Step 13: The following page will prompt for startup options. Click next to continue with the setup.
Step 14: The following page will ask to select the start menu folder. Click next to continue with the setup
Step 15: The following page will ask to select additional tasks. Click next to continue with the setup.
Step 16: This Should install R on the machine. It will take some time and after that, it will show completing the windows setup. Click Finish to end the setup.
Step 17: Select either of the below steps to start R.
Step 18: Find the R icon on the desktop and double click on the icon to start the program. If the R icon is not available on the desktop to follow the below step.
Step 19: Select the start menu from there select the all programs option, after that, you will find the R icon. Click on the icon to run the program.
Step 20: R console like below will appear and the R program will get started.
Brief Working Knowledge on R
1. The R commands have to be written into the console for carrying out different analyses. Blue is an example of an R prompt. The commands are submitted by pressing the enter key.
2. After starting up R, commands can be submitted into the console and the results will be calculated immediately. Below are a few examples:
3. All variables including scalers, vectors, matrices, etc those are created by R are called objects. Values to variables are assigned using an arrow in R. For example, we can assign the value 2*3 to the variable x using the below command.
> x <- 2*3
4. For viewing the content of any object only typing its name is enough and the contents will be displayed. Below is an example:
5. Their different types of objects in R like arrays, matrices, vectors, scalars, lists, tables, and data frames. The scalar variable text shown above is an example of an R object. Unlike a scalar variable that contains a single element, a vector consists of several elements. The elements that are stored in a vector is of the same type as numeric or characters. A list consists of different types of elements consisting of both numeric or character.
6. R offers a help function and it can be used to get the details of any command and its usage. Below is an example of getting help for the log function:
7. When someone is not sure of the exact function or knows it partially, it can be searched with either help.search() and RSiteSearch() functions.
This is a guide to Install R. Here we discuss the basic concept, Prerequisites, Step by Step Process of Installation, and brief knowledge on how it works. You may also look at the following articles to learn more –