SlideShare a Scribd company logo
By – Sarthak Bhargava |
17100BTCSE01269
Topic : R - Programming
Shri Vaishnav Vidyapeeth
Vishwavidyalaya
TABLE OF CONTENTS
• History
• Introduction
• R Basics
• Download and Install R
• GUI /IDE
• Datatypes and Operators
• Conditional Statements and Loops
• Functions
• Plotting
• Features
• Comparison with other programming languages
• Merits / Advantages
• Demerits / Disadvantages
• Conclusion
History
R is an implementation of the S programming
language combined with lexical scoping semantics, inspired
by Scheme. S was created by John Chambers in 1976, while
at Bell Labs. There are some important differences, but much
of the code written for S runs unaltered.
R was created by Ross Ihaka and Robert Gentleman at
the University of Auckland, New Zealand, and is currently
developed by the R Development Core Team (of which
Chambers is a member). R is named partly after the first names
of the first two R authors and partly as a play on the name of S.
The project was conceived in 1992, with an initial version
released in 1995 and a stable beta version (v1.0) on 29th
February, 2000.
Introduction
R is a programming language and software environment for statistical
computing and graphics. The R language is widely used among statisticians
and data miners for developing statistical software and dataanalysis.
It compiles and runs on a wide variety of UNIX platforms, Windows and Mac
OS. R can be downloaded and installed from CRAN website , CRAN stands
for Comprehensive R Archive Network.
R Basics
Download and Install R –
1. Download R from (direct download link) –
https://cran.r-project.org/bin/windows/base/R-3.6.3-win.exe
2. Run exe file
-> Select language
-> Select Location
-> Select Component
-> Select startup option
-> After installation click Finish
GUI / IDE
There are many GUI to use R language such as R studio, pycharm etc.
For this ppt, I am going to use pycharm, To use R programming in pycharm Download and install R
plugin and create R project.
( Images at Next Side)
Installation
Pycharm IDE for
R Programming
Datatypes in R and Operators
R supports various basic Datatype such as Integer,Complex, Boolean, Character etc. and R also support some
objects called R-Object which are –
1. Vectors -Vector is a sequence of data elements of the same basic type.
2. Lists – List is GenericVector.
3. Matrices – It is a collection of data elements arranged in a two-dimensional rectangular layout
4. Arrays – Arrays are the R data objects which can store data in more than two dimensions.
5. Factors – Factors are the data objects which are used to categorize the data and store it as levels.They
can store both strings and integers.
6. Data Frames - A data frame is a table or a
two-dimensional array-like structure in
which each column contains values of
one variable and each row contains one
set of values from each column.
R supports all operator (like other
Programming languages) and have some
more like “<-” which is also assignment
operator
Conditional Statements / Control Statements
–
1. If – An if statement consists of a Boolean
expression followed by one or more statements.
2. if…..else – An if statement can be followed by an
optional else statement, which executes when the
Boolean expression is false.
3. switch – A switch statement allows a variable to be
tested for equality against a list of values.
Loops –
1. repeat - Executes a sequence of statements
multiple times and abbreviates the code that
manages the loop variable.
2. while - Repeats a statement or group of
statements while a given condition is true. It tests
the condition before executing the loop body.
3. for - Like a while statement, except that it tests the
condition at the end of the loop body.
Control Statements and loops
Control statements with output
for loop with output
while loop with outputrepeat loop with output
Functions
An R function is created by using the keyword function. The basic syntax of an R function definition is as follows −
function_name <- function(arg_1,arg_2 , …..){
Function_body
return_value
}
The different parts of a function are −
1. Function Name − This is the actual name of the function. It is stored in R environment as an object with this name.
2. Arguments − An argument is a placeholder. When a function is invoked, you pass a value to the argument.
Arguments are optional; that is, a function may contain no arguments. Also arguments can have default values.
3. Function Body − The function body contains a collection of statements that defines what the function does.
4. Return Value − The return value of a function is the last expression in the function body to be evaluated.
Some of R built-in functions are –
1. c() – This is a generic function which combines its arguments.
2. seq() – Create Sequence of Number
3. mean() – Give mean of argument
4. sum() – Give Sum of arguments
5. plot() – Plot graph of argument
Plotting Example
As stated earlier, R is a programming language and software environment for
statistical analysis, graphics representation and reporting. The following are the
important features of R −
• R is a well-developed, simple and effective programming language which includes conditionals,
loops, user defined recursive functions and input and output facilities.
• R has an effective data handling and storage facility,
• R provides a suite of operators for calculations on arrays, lists, vectors and matrices.
• R provides a large, coherent and integrated collection of tools for data analysis.
• R provides graphical facilities for data analysis and display either directly at the computer or printing
at the papers.
Features of R
Comparison with other languages
R Python Java
First appeared in 1993 First appeared in 1991 First appeared in 1995
It has more functions and
packages.
It has less functions and
packages.
It has large number of inbuilt
functions and packages.
It is an interpreter base
language
It is an interpreter base
language.
It is interpreter and compiled
based language.
It is statistical design and
graphics Programming
language.
It is general purpose language
It is general purpose
Programming language
designed for web applications
It is difficult to learn and
understand.
It is easy to understand..
It is easy to learn and
understand.
R is mostly use for data
analysis.
Generic programming, tasks such
as design of softwares.
Java is mostly used in design
of windows applications and
web
Merits / Advantages
1. Open Source
2. Exemplary Support for Data Wrangling
3. The Array of Packages
4. Quality Plotting and Graphing
5. Highly Compatible
6. Platform Independent
7. Eye-Catching Reports
8. Machine Learning Operations
9. Statistics
10. Continuously Growing
Demerits / Disadvantages
1. Weak Origin
2. Data Handling
3. Basic Security
4. Complicated Language
5. Lesser Speed
6. Spread Across various Packages
Conclusion
• R is a OOPs Programming language which is mostly used by data
analytics and data scientists.
• R is Interpreted language having some syntax of java as well as
Python.
• R supports all datatype and supports different data-structures called
R-objects
• R is mostly used for Plotting Purposes.
• R mostly use Functions and packages.
At last R provides us an Eye-Catching Reports and can easily plot graph
of given data which is easy to read and understand, this is also a reason
why it is soo popular,
Thank You

More Related Content

What's hot

R Programming: Variables & Data Types
R Programming: Variables & Data TypesR Programming: Variables & Data Types
R Programming: Variables & Data Types
Rsquared Academy
 
Step By Step Guide to Learn R
Step By Step Guide to Learn RStep By Step Guide to Learn R
Step By Step Guide to Learn R
Venkata Reddy Konasani
 
Introduction to Rstudio
Introduction to RstudioIntroduction to Rstudio
Introduction to Rstudio
Olga Scrivner
 
R Programming: Introduction To R Packages
R Programming: Introduction To R PackagesR Programming: Introduction To R Packages
R Programming: Introduction To R Packages
Rsquared Academy
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
Dashani Rajapaksha
 
Object oriented dbms
Object oriented dbmsObject oriented dbms
Object oriented dbms
Kartik Kalpande Patil
 
R Programming
R ProgrammingR Programming
R Programming
Abhishek Pratap Singh
 
R Programming: Introduction to Matrices
R Programming: Introduction to MatricesR Programming: Introduction to Matrices
R Programming: Introduction to Matrices
Rsquared Academy
 
Introduction to R and R Studio
Introduction to R and R StudioIntroduction to R and R Studio
Introduction to R and R Studio
Rupak Roy
 
Unit 1 - R Programming (Part 2).pptx
Unit 1 - R Programming (Part 2).pptxUnit 1 - R Programming (Part 2).pptx
Unit 1 - R Programming (Part 2).pptx
Malla Reddy University
 
3. R- list and data frame
3. R- list and data frame3. R- list and data frame
3. R- list and data frame
krishna singh
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)
Guy Lebanon
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
Nishant Munjal
 
Data Abstraction
Data AbstractionData Abstraction
Data Abstraction
A. S. M. Shafi
 
DATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEM
Mahmud Hasan Tanvir
 
R Programming For Beginners | R Language Tutorial | R Tutorial For Beginners ...
R Programming For Beginners | R Language Tutorial | R Tutorial For Beginners ...R Programming For Beginners | R Language Tutorial | R Tutorial For Beginners ...
R Programming For Beginners | R Language Tutorial | R Tutorial For Beginners ...
Edureka!
 
Xml
XmlXml
SQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTIONSQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTION
Arun Sial
 

What's hot (20)

R Programming: Variables & Data Types
R Programming: Variables & Data TypesR Programming: Variables & Data Types
R Programming: Variables & Data Types
 
Step By Step Guide to Learn R
Step By Step Guide to Learn RStep By Step Guide to Learn R
Step By Step Guide to Learn R
 
Introduction to Rstudio
Introduction to RstudioIntroduction to Rstudio
Introduction to Rstudio
 
DBA101
DBA101DBA101
DBA101
 
R Programming: Introduction To R Packages
R Programming: Introduction To R PackagesR Programming: Introduction To R Packages
R Programming: Introduction To R Packages
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Object oriented dbms
Object oriented dbmsObject oriented dbms
Object oriented dbms
 
R Programming
R ProgrammingR Programming
R Programming
 
R Programming: Introduction to Matrices
R Programming: Introduction to MatricesR Programming: Introduction to Matrices
R Programming: Introduction to Matrices
 
Introduction to R and R Studio
Introduction to R and R StudioIntroduction to R and R Studio
Introduction to R and R Studio
 
Unit 1 - R Programming (Part 2).pptx
Unit 1 - R Programming (Part 2).pptxUnit 1 - R Programming (Part 2).pptx
Unit 1 - R Programming (Part 2).pptx
 
3. R- list and data frame
3. R- list and data frame3. R- list and data frame
3. R- list and data frame
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Data Abstraction
Data AbstractionData Abstraction
Data Abstraction
 
DATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEM
 
R Programming For Beginners | R Language Tutorial | R Tutorial For Beginners ...
R Programming For Beginners | R Language Tutorial | R Tutorial For Beginners ...R Programming For Beginners | R Language Tutorial | R Tutorial For Beginners ...
R Programming For Beginners | R Language Tutorial | R Tutorial For Beginners ...
 
Xml
XmlXml
Xml
 
SQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTIONSQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTION
 

Similar to R programming Language

1_Introduction.pptx
1_Introduction.pptx1_Introduction.pptx
1_Introduction.pptx
ranapoonam1
 
R basics for MBA Students[1].pptx
R basics for MBA Students[1].pptxR basics for MBA Students[1].pptx
R basics for MBA Students[1].pptx
rajalakshmi5921
 
R programming Language , Rahul Singh
R programming Language , Rahul SinghR programming Language , Rahul Singh
R programming Language , Rahul Singh
Ravi Basil
 
Financial Risk Mgt - Lec 4 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 4 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 4 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 4 by Dr. Syed Muhammad Ali Tirmizi
Dr. Muhammad Ali Tirmizi., Ph.D.
 
Data Science - Part II - Working with R & R studio
Data Science - Part II -  Working with R & R studioData Science - Part II -  Working with R & R studio
Data Science - Part II - Working with R & R studio
Derek Kane
 
FULL R PROGRAMMING METERIAL_2.pdf
FULL R PROGRAMMING METERIAL_2.pdfFULL R PROGRAMMING METERIAL_2.pdf
FULL R PROGRAMMING METERIAL_2.pdf
attalurilalitha
 
Language-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchLanguage-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible research
Andrew Lowe
 
Presentation c++
Presentation c++Presentation c++
Presentation c++
JosephAlex21
 
R Course Online
R Course OnlineR Course Online
R Course Online
bestonlinecoursescoupon
 
Language design and translation issues
Language design and translation issuesLanguage design and translation issues
Language design and translation issues
SURBHI SAROHA
 
R training
R trainingR training
R training
Hellen Gakuruh
 
Inroduction to r
Inroduction to rInroduction to r
Inroduction to r
manikanta361
 
r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packagesAjay Ohri
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming languageVasavi College of Engg
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
Mugilvannan11
 
Study of R Programming
Study of R ProgrammingStudy of R Programming
Study of R Programming
IRJET Journal
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
ZcelTablizo3
 
Introduction to R Programming
Introduction to R ProgrammingIntroduction to R Programming
Introduction to R Programming
hemasri56
 
R programming presentation
R programming presentationR programming presentation
R programming presentation
Akshat Sharma
 

Similar to R programming Language (20)

1_Introduction.pptx
1_Introduction.pptx1_Introduction.pptx
1_Introduction.pptx
 
R basics for MBA Students[1].pptx
R basics for MBA Students[1].pptxR basics for MBA Students[1].pptx
R basics for MBA Students[1].pptx
 
R programming Language , Rahul Singh
R programming Language , Rahul SinghR programming Language , Rahul Singh
R programming Language , Rahul Singh
 
Financial Risk Mgt - Lec 4 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 4 by Dr. Syed Muhammad Ali TirmiziFinancial Risk Mgt - Lec 4 by Dr. Syed Muhammad Ali Tirmizi
Financial Risk Mgt - Lec 4 by Dr. Syed Muhammad Ali Tirmizi
 
Data Science - Part II - Working with R & R studio
Data Science - Part II -  Working with R & R studioData Science - Part II -  Working with R & R studio
Data Science - Part II - Working with R & R studio
 
FULL R PROGRAMMING METERIAL_2.pdf
FULL R PROGRAMMING METERIAL_2.pdfFULL R PROGRAMMING METERIAL_2.pdf
FULL R PROGRAMMING METERIAL_2.pdf
 
Language-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchLanguage-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible research
 
Presentation c++
Presentation c++Presentation c++
Presentation c++
 
R Course Online
R Course OnlineR Course Online
R Course Online
 
Language design and translation issues
Language design and translation issuesLanguage design and translation issues
Language design and translation issues
 
R training
R trainingR training
R training
 
Inroduction to r
Inroduction to rInroduction to r
Inroduction to r
 
r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packages
 
Lecture1
Lecture1Lecture1
Lecture1
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
 
Study of R Programming
Study of R ProgrammingStudy of R Programming
Study of R Programming
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Introduction to R Programming
Introduction to R ProgrammingIntroduction to R Programming
Introduction to R Programming
 
R programming presentation
R programming presentationR programming presentation
R programming presentation
 

Recently uploaded

Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 

Recently uploaded (20)

Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 

R programming Language

  • 1. By – Sarthak Bhargava | 17100BTCSE01269 Topic : R - Programming Shri Vaishnav Vidyapeeth Vishwavidyalaya
  • 2. TABLE OF CONTENTS • History • Introduction • R Basics • Download and Install R • GUI /IDE • Datatypes and Operators • Conditional Statements and Loops • Functions • Plotting • Features • Comparison with other programming languages • Merits / Advantages • Demerits / Disadvantages • Conclusion
  • 3. History R is an implementation of the S programming language combined with lexical scoping semantics, inspired by Scheme. S was created by John Chambers in 1976, while at Bell Labs. There are some important differences, but much of the code written for S runs unaltered. R was created by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand, and is currently developed by the R Development Core Team (of which Chambers is a member). R is named partly after the first names of the first two R authors and partly as a play on the name of S. The project was conceived in 1992, with an initial version released in 1995 and a stable beta version (v1.0) on 29th February, 2000.
  • 4. Introduction R is a programming language and software environment for statistical computing and graphics. The R language is widely used among statisticians and data miners for developing statistical software and dataanalysis. It compiles and runs on a wide variety of UNIX platforms, Windows and Mac OS. R can be downloaded and installed from CRAN website , CRAN stands for Comprehensive R Archive Network.
  • 5. R Basics Download and Install R – 1. Download R from (direct download link) – https://cran.r-project.org/bin/windows/base/R-3.6.3-win.exe 2. Run exe file -> Select language -> Select Location -> Select Component -> Select startup option -> After installation click Finish GUI / IDE There are many GUI to use R language such as R studio, pycharm etc. For this ppt, I am going to use pycharm, To use R programming in pycharm Download and install R plugin and create R project. ( Images at Next Side)
  • 7. Datatypes in R and Operators R supports various basic Datatype such as Integer,Complex, Boolean, Character etc. and R also support some objects called R-Object which are – 1. Vectors -Vector is a sequence of data elements of the same basic type. 2. Lists – List is GenericVector. 3. Matrices – It is a collection of data elements arranged in a two-dimensional rectangular layout 4. Arrays – Arrays are the R data objects which can store data in more than two dimensions. 5. Factors – Factors are the data objects which are used to categorize the data and store it as levels.They can store both strings and integers. 6. Data Frames - A data frame is a table or a two-dimensional array-like structure in which each column contains values of one variable and each row contains one set of values from each column. R supports all operator (like other Programming languages) and have some more like “<-” which is also assignment operator
  • 8. Conditional Statements / Control Statements – 1. If – An if statement consists of a Boolean expression followed by one or more statements. 2. if…..else – An if statement can be followed by an optional else statement, which executes when the Boolean expression is false. 3. switch – A switch statement allows a variable to be tested for equality against a list of values. Loops – 1. repeat - Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable. 2. while - Repeats a statement or group of statements while a given condition is true. It tests the condition before executing the loop body. 3. for - Like a while statement, except that it tests the condition at the end of the loop body. Control Statements and loops Control statements with output for loop with output while loop with outputrepeat loop with output
  • 9. Functions An R function is created by using the keyword function. The basic syntax of an R function definition is as follows − function_name <- function(arg_1,arg_2 , …..){ Function_body return_value } The different parts of a function are − 1. Function Name − This is the actual name of the function. It is stored in R environment as an object with this name. 2. Arguments − An argument is a placeholder. When a function is invoked, you pass a value to the argument. Arguments are optional; that is, a function may contain no arguments. Also arguments can have default values. 3. Function Body − The function body contains a collection of statements that defines what the function does. 4. Return Value − The return value of a function is the last expression in the function body to be evaluated. Some of R built-in functions are – 1. c() – This is a generic function which combines its arguments. 2. seq() – Create Sequence of Number 3. mean() – Give mean of argument 4. sum() – Give Sum of arguments 5. plot() – Plot graph of argument
  • 11. As stated earlier, R is a programming language and software environment for statistical analysis, graphics representation and reporting. The following are the important features of R − • R is a well-developed, simple and effective programming language which includes conditionals, loops, user defined recursive functions and input and output facilities. • R has an effective data handling and storage facility, • R provides a suite of operators for calculations on arrays, lists, vectors and matrices. • R provides a large, coherent and integrated collection of tools for data analysis. • R provides graphical facilities for data analysis and display either directly at the computer or printing at the papers. Features of R
  • 12. Comparison with other languages R Python Java First appeared in 1993 First appeared in 1991 First appeared in 1995 It has more functions and packages. It has less functions and packages. It has large number of inbuilt functions and packages. It is an interpreter base language It is an interpreter base language. It is interpreter and compiled based language. It is statistical design and graphics Programming language. It is general purpose language It is general purpose Programming language designed for web applications It is difficult to learn and understand. It is easy to understand.. It is easy to learn and understand. R is mostly use for data analysis. Generic programming, tasks such as design of softwares. Java is mostly used in design of windows applications and web
  • 13. Merits / Advantages 1. Open Source 2. Exemplary Support for Data Wrangling 3. The Array of Packages 4. Quality Plotting and Graphing 5. Highly Compatible 6. Platform Independent 7. Eye-Catching Reports 8. Machine Learning Operations 9. Statistics 10. Continuously Growing
  • 14. Demerits / Disadvantages 1. Weak Origin 2. Data Handling 3. Basic Security 4. Complicated Language 5. Lesser Speed 6. Spread Across various Packages
  • 15. Conclusion • R is a OOPs Programming language which is mostly used by data analytics and data scientists. • R is Interpreted language having some syntax of java as well as Python. • R supports all datatype and supports different data-structures called R-objects • R is mostly used for Plotting Purposes. • R mostly use Functions and packages. At last R provides us an Eye-Catching Reports and can easily plot graph of given data which is easy to read and understand, this is also a reason why it is soo popular,