Basics of R Programming
Lecture Delivered By :
Santosh Kumar Yadav
Lecturer, CSE Deptt.
CCET (Diploma Wing)
Installation of R Programming and R studio
1. To Install R
https://cran.r-project.org/bin/windows/base/
2. To install R Studio for Free Desktop version
https://rstudio.com/products/rstudio/download/#download
Difference between R and R studio
Is it necessary to install R Studio to run R? Absolutely No, but using R
programming with R Studio makes the things easier and user friendly. So,
it should be installed and R programs to be executed in R studio.
Following are the main features available in R Studio:
1. Working with Rstudio like managing the plot, graph etc is quite easier.
2. Import facility is available with menu.
3. Easier to create a scripting file in R Studio
4. Having integrated platform to show script window, console window,
workspace and plot area for graphs etc.
5. It facilitates the feature of R markdown (it allows you to embed R code
and R output directly into documents such as PDF, HTML, Word, etc.)
6. It allows to create new projects (which helps to manage all files and
output related to it in a project in one spot.)
7. It allows to save the graph(plot).
Difference between R Programming and R studio
Working Difference in R programming and R Studio
Difference between R Programming and R studio
Working Difference in R programming and R Studio
Working with R Studio
Basic Example of R Program:
Working with R Studio
Basic Example of R Program:
x,y,z are variable or array variable having range of values,
Plot (x,y): is used to plot graph between x and y
Sum(x,y,z) is used to add these attributes and result is
shown as 120
ls() function is used to show the list of variable available in
work space.
Working with R Studio
Arithmetic Commands:
Working with R Studio
Arithmetic Commands:
Arrow up and Down to see the previous and next command.
Working with R Studio
Working with Vector and Matrix:
Working with R Studio
Working with Vector and Matrix:
Working with R Studio
Working with Vector and Matrix:
Working with R Studio
Working with Vector and Matrix:
Working with R Studio
Working with Vector and Matrix:
Working with R Studio
Importing Data from Excel to R:
Data can be imported from other source but excel is
popular source. Save the data file as: comma separated
value (.csv) or tab delimited text file(.txt).
.csv file when opened in text editor like notepad every
attribute is comma separated.
Working with R Studio
Importing Data from Excel to R:
Check the help function to see the working of read.csv function()
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Importing Data from Excel to R:
.csv file saved as tab delimited text file
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Importing Data from Excel to R:
Working with R
Importing Data from Excel to R:
Studio
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Importing Data from Excel to R:
Working with R Studio
Exporting Data from Excel to R:
Most widely used command is write.table command to export data from R.
Working with
Exporting Data from Excel to R:
R Studio
Working with R Studio
Exporting Data from Excel to R:
Working with R Studio
Exporting Data from Excel to R: How to Set Working Directory
Working with R Studio
Exporting Data from Excel to R: rownames attribute
Working with R Studio
Exporting Data from Excel to R: Row name argument is True here.
Working with R Studio
Exporting Data from Excel to R: Row name argument is false here. First row having
number is erased.
Working with R Studio
Exporting Data from Excel to R: write.table and write.csv with path
Working with R Studio
Exporting Data from Excel to R:
Working with R Studio
Exporting Data from Excel to R: write.table in other format
Working with R Studio
Exporting Data from Excel to R: From where to get the data set
Working with R Studio
Working with variables and data:
Mean function for any variable: mean command and $ use
Working with R Studio
Working with variables and data: Working of attached and detach command