R programming language is freely available in GNU General Public Licence, open source, powerful and highly extensible. R programming language is used heavily for Statistical computing and data analysis in data mining and is a favourite programming language for Data Scientist. R name was coined after its authors Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand. It was written in 1993. R software comes with in built packages of operators for calculations on arrays, lists, vectors and matrices. R is also used for Graphical representation of historical datasets.
Installation of R
Download the R 3.3.1 version from its official website [r.project.org] for 32/64 bits and install its respective bit versions based on your Windows OS bit. By default, the installer will install both the versions side by side. By default, all softwares are installed in C:\ProgramFiles directory. For R installation please create a directory as C:\R-3.3.1 while doing the installation to avoid messing up with protection mode of C:\ProgramFiles folder. Run the shortcut exe for R, this will open RGUI window for programming.
> myString <- “Hi Amit”
 “Hi Amit”
R Script File
All R programs are written and stored in a file called R Script file with an extension of .R
For example let’s say a R script first_program.R has below content
#First Program of R
myString <- “Hi! This is my first program”
save the file first_program.R and run it
In unix prompt as:
- Rscript first_program.R
Go to RGUI –> File –> Open Script –> go to the folder where the script first_program.R is saved –> Select first_program.R –> Open –> Copy the code in first_program.R to RConsole –> Press Enter –> It will execute the code and display the output in the R Console.