SlideShare a Scribd company logo
9
Most read
12
Most read
13
Most read
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 (20)

PPT
Compiler Design
Mir Majid
 
PPTX
sutherland- Hodgeman Polygon clipping
Arvind Kumar
 
PPTX
Character Attribute in computer graphics
HariTharshiniBscIT1
 
PPTX
K Nearest Neighbor Algorithm
Tharuka Vishwajith Sarathchandra
 
PPTX
K-Nearest Neighbor Classifier
Neha Kulkarni
 
PDF
Unit 3
ypnrao
 
PPTX
Compiler Design
Dr. Jaydeep Patil
 
PPTX
History of C Programming Language
Niloy Biswas
 
PPTX
Introduction to Basics of Python
Elewayte
 
PDF
Syntax directed translation
Akshaya Arunan
 
PPTX
The data mining query language
Ishucs
 
PPT
Unit 7 Java
arnold 7490
 
PPTX
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Andrew Ferlitsch
 
PPTX
Cs8092 computer graphics and multimedia unit 5
SIMONTHOMAS S
 
PDF
Intro to RStudio
egoodwintx
 
PPT
1. over view and history of c
Harish Kumawat
 
PPTX
Projection In Computer Graphics
Sanu Philip
 
PPTX
Functional dependency
Tamajit Chakraborty
 
PPTX
Data mining primitives
lavanya marichamy
 
Compiler Design
Mir Majid
 
sutherland- Hodgeman Polygon clipping
Arvind Kumar
 
Character Attribute in computer graphics
HariTharshiniBscIT1
 
K Nearest Neighbor Algorithm
Tharuka Vishwajith Sarathchandra
 
K-Nearest Neighbor Classifier
Neha Kulkarni
 
Unit 3
ypnrao
 
Compiler Design
Dr. Jaydeep Patil
 
History of C Programming Language
Niloy Biswas
 
Introduction to Basics of Python
Elewayte
 
Syntax directed translation
Akshaya Arunan
 
The data mining query language
Ishucs
 
Unit 7 Java
arnold 7490
 
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Andrew Ferlitsch
 
Cs8092 computer graphics and multimedia unit 5
SIMONTHOMAS S
 
Intro to RStudio
egoodwintx
 
1. over view and history of c
Harish Kumawat
 
Projection In Computer Graphics
Sanu Philip
 
Functional dependency
Tamajit Chakraborty
 
Data mining primitives
lavanya marichamy
 

Similar to R programming Language (20)

PPTX
R programming Language , Rahul Singh
Ravi Basil
 
PPTX
R Programming Language
NareshKarela1
 
PPTX
R basics for MBA Students[1].pptx
rajalakshmi5921
 
PPTX
1_Introduction.pptx
ranapoonam1
 
PPTX
Introduction to R Programming
hemasri56
 
PPTX
R programming
Shantanu Patil
 
PPTX
Data Science With R Programming Unit - II Part-1.pptx
narasimharaju03
 
PPTX
Data science with R Unit - II Part-1.pptx
narasimharaju03
 
PPTX
Big data analytics with R tool.pptx
salutiontechnology
 
PDF
R programming advantages and disadvantages
PrwaTech
 
PPTX
R for Beginners with applications 1 R for Beginners with applications 1
Abdesselam FILALI
 
PPTX
R programming language
Keerti Verma
 
PPTX
Basics-of-R-programming.9625714.powerpoint.pptx
MSANDHYARANI3
 
PPTX
R programming
Pooja Sharma
 
PDF
R Programming - part 1.pdf
RohanBorgalli
 
PDF
UNIT-4 Start Learning R and installation .pdf
geethar79
 
PDF
UNIT-1 Start Learning R.pdf
Sweta Kumari Barnwal
 
PDF
2 it unit-1 start learning r
Netaji Gandi
 
PPTX
R_L1-Aug-2022.pptx
ShantilalBhayal1
 
PPTX
R Programming and Lab - Unit I PPTX with examples
SARAVANA KUMAR SS
 
R programming Language , Rahul Singh
Ravi Basil
 
R Programming Language
NareshKarela1
 
R basics for MBA Students[1].pptx
rajalakshmi5921
 
1_Introduction.pptx
ranapoonam1
 
Introduction to R Programming
hemasri56
 
R programming
Shantanu Patil
 
Data Science With R Programming Unit - II Part-1.pptx
narasimharaju03
 
Data science with R Unit - II Part-1.pptx
narasimharaju03
 
Big data analytics with R tool.pptx
salutiontechnology
 
R programming advantages and disadvantages
PrwaTech
 
R for Beginners with applications 1 R for Beginners with applications 1
Abdesselam FILALI
 
R programming language
Keerti Verma
 
Basics-of-R-programming.9625714.powerpoint.pptx
MSANDHYARANI3
 
R programming
Pooja Sharma
 
R Programming - part 1.pdf
RohanBorgalli
 
UNIT-4 Start Learning R and installation .pdf
geethar79
 
UNIT-1 Start Learning R.pdf
Sweta Kumari Barnwal
 
2 it unit-1 start learning r
Netaji Gandi
 
R_L1-Aug-2022.pptx
ShantilalBhayal1
 
R Programming and Lab - Unit I PPTX with examples
SARAVANA KUMAR SS
 
Ad

Recently uploaded (20)

PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PDF
Electrical Engineer operation Supervisor
ssaruntatapower143
 
PPTX
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PPTX
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
PDF
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
PDF
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
PPTX
Depth First Search Algorithm in 🧠 DFS in Artificial Intelligence (AI)
rafeeqshaik212002
 
PPTX
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
PPTX
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
DOCX
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
PPT
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
PDF
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
PPTX
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
PDF
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
PDF
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
PDF
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
PPTX
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
PDF
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
Electrical Engineer operation Supervisor
ssaruntatapower143
 
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
MRRS Strength and Durability of Concrete
CivilMythili
 
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
Depth First Search Algorithm in 🧠 DFS in Artificial Intelligence (AI)
rafeeqshaik212002
 
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
Ad

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,