SlideShare a Scribd company logo
1 of 15
Download to read offline
Introduction to R
• Statistics is a collection of tools used for converting raw data into
information to help decision makers in their work.
• Types of Statistics:
Descriptive statistics is devoted to the summarization and description
of data.
Inferential statistics uses sample data to make an inference about a
population.
Statistical Analysis of Data using R
• Statistical Software Packages
1) SAS
2) SPSS
3) STATA
4) Microsoft Excel
5) R
Introduction to R
• R Language:
In 1991, R was created by Ross Ihaka and Robert Gentleman in the
Department of Statistics at the University of Auckland. In 1993 the first
announcement of R was made to the public.
• In 2000 R version 1.0.0 was released to the public.
• Philosophy – ‘How to Make Data Analysis Easier’
• The primary R system is available from the Comprehensive R Archive
Network, also known as CRAN.
• The main source code archives are maintained by a dedicated group
known as the R Core Team
http://cran.r-project.org
Introduction to R
• Installation – R GUI
Search “download R”. Go to
https://cran.r-project.org/bin/windows/base/
Click on Download R 4.1.1 for Windows (84 megabytes, 32/64 bit)
Save the file and run as administrator. Accept all default setting for
installation and complete installation process.
• There is also an integrated development environment (IDE) available for R
that is built by RStudio.
Introduction to R
• Installation – RStudio
Search “download RStudio”. Go to
https://rstudio.com/products/rstudio/download/ Click on First option
RStudio Desktop (FREE) to download
Save the file and run as administrator. Accept all default setting for
installation and complete installation process.
• Set your working directory, which lets R know where to find all of your
files.
Introduction to R
• Panels of RStudio
The source editor and data viewer panel
The R console
The command history and workspace browser
The file, help, package, and plots panel
Rstudio IDE: Cheat Sheet
R scripts – .R extension
Introduction to R
•
Statistical Analysis of Data using R
• Using Packages :-
• R packages (or libraries) are collections of code that hold data and functionality
used in R. (i) Installed and automatically loaded, (ii) installed but need to
activate, (iii) Require to install
• install.packages("arules") and update.packages() , citation citation(“arules”)
• Writing own packages -- Writing R Extensions manual
• Wickham, H. (2015b). R Packages. O’Reilly Media, USA.
• The R Journal - https://journal.r-project.org/
Introduction to R
• Initial Codes
• Function/operator Brief description
options Set various R options
# A comment (ignored by interpreter)
getwd Print current working directory
setwd Set current working directory
library Load an installed package
install.packages Download and install package
update.packages Update installed packages
help or ? Function/object help file
help.search or ?? Search help files
q Quit R
Statistical Analysis of Data using R
• The basics of simple arithmetic, assignment, and important object types such as
vectors, matrices, lists, and data frames.
• Functions, loops and conditional statements, which are used to control the flow,
repetition, and execution of ‘your code’.
• Elementary summary statistics such as the mean, variance, quantiles, and
correlation
• Visually explore your data (with both built-in and ggplot2 functionality) by using
and customizing common statistical plots such as histograms and box- and-whisker
plots.
• R implementation and statistical interpretation of some common probability
distributions.
Statistical Analysis of Data using R
• Sampling distributions and confidence intervals
• hypothesis testing and p-values and demonstrates implementation and
interpretation using R; the common ANOVA
• Linear regression modeling
• ??
Statistical Analysis of Data using R
• R Language:
• Data Objects: Vector, List, Matrix, Data Frame
• Data Types: Integer, Numeric (Real Numbers), Logical
(True/False), Character, Complex
• R Packages:
R Packages are collections of R functions, data, and compiled code. It
will facilitate to allow specialized statistical techniques, graphical device
(such as ggplot2)
Ex:- stats, dplyr
Currently, the CRAN package repository features 16052 available packages
Statistical Analysis of Data using R
• Importing Data in R:
The most common way is using read.table() function (.txt).
Quite often we have comma (,) separated data values. Such a data
file can be imported into R using read.csv().
read.csv(file, header = TRUE, sep = ",", quote = """, dec = ".", ...)
Use read.table() or read.csv() function to import the file into R
• Importing an Excel File:
Download readxl package from CRAN. Load it in the workspace and
use read_excel() function to import excel file into R.
• data()
Statistical Analysis of Data using R
• Objectives
Entering the Input and Evaluation
Creating Vectors – The c() function can be used to create vectors of
objects by concatenating things together.
Finding descriptive measures like range, averages, variation (CV),
five-number and summary, dotplot and boxplot diagram
Perform t-test
Discrete Frequency Distribution and graphs
Creating Matrix – The matrix() function is used (AP)
•
Statistical Analysis of Data using R
• Objectives
Compute Binomial distribution, Poisson distribution and Normal
distribution Probability
Read data from external source using read.csv
Perform Cluster Analysis
Obtain Summary , Tables and Graphs
Manage dataframe using dplyr package
•

More Related Content

Similar to PPT - Introduction to R.pdf

A Handbook Of Statistical Analyses Using R
A Handbook Of Statistical Analyses Using RA Handbook Of Statistical Analyses Using R
A Handbook Of Statistical Analyses Using RNicole Adams
 
Introduction to basic statistics
Introduction to basic statisticsIntroduction to basic statistics
Introduction to basic statisticsIBM
 
Intro to R statistic programming
Intro to R statistic programming Intro to R statistic programming
Intro to R statistic programming Bryan Downing
 
An R primer for SQL folks
An R primer for SQL folksAn R primer for SQL folks
An R primer for SQL folksThomas Hütter
 
Advanced Data Analytics with R Programming.ppt
Advanced Data Analytics with R Programming.pptAdvanced Data Analytics with R Programming.ppt
Advanced Data Analytics with R Programming.pptAnshika865276
 
Slides on introduction to R by ArinBasu MD
Slides on introduction to R by ArinBasu MDSlides on introduction to R by ArinBasu MD
Slides on introduction to R by ArinBasu MDSonaCharles2
 
Introduction to R Programming
Introduction to R ProgrammingIntroduction to R Programming
Introduction to R Programminghemasri56
 
Research paper presentation
Research paper presentation Research paper presentation
Research paper presentation Akshat Sharma
 
Basic Analytic Techniques - Using R Tool - Part 1
Basic Analytic Techniques - Using R Tool - Part 1Basic Analytic Techniques - Using R Tool - Part 1
Basic Analytic Techniques - Using R Tool - Part 1Beamsync
 
Data Analytics with R and SQL Server
Data Analytics with R and SQL ServerData Analytics with R and SQL Server
Data Analytics with R and SQL ServerStéphane Fréchette
 

Similar to PPT - Introduction to R.pdf (20)

Introduction to R software, by Leire ibaibarriaga
Introduction to R software, by Leire ibaibarriaga Introduction to R software, by Leire ibaibarriaga
Introduction to R software, by Leire ibaibarriaga
 
R Intro
R IntroR Intro
R Intro
 
محاضرة برنامج التحليل الكمي R program د.هديل القفيدي
محاضرة برنامج التحليل الكمي   R program د.هديل القفيديمحاضرة برنامج التحليل الكمي   R program د.هديل القفيدي
محاضرة برنامج التحليل الكمي R program د.هديل القفيدي
 
R training
R trainingR training
R training
 
A Handbook Of Statistical Analyses Using R
A Handbook Of Statistical Analyses Using RA Handbook Of Statistical Analyses Using R
A Handbook Of Statistical Analyses Using R
 
Introduction to basic statistics
Introduction to basic statisticsIntroduction to basic statistics
Introduction to basic statistics
 
R tutorial
R tutorialR tutorial
R tutorial
 
Intro to R statistic programming
Intro to R statistic programming Intro to R statistic programming
Intro to R statistic programming
 
An R primer for SQL folks
An R primer for SQL folksAn R primer for SQL folks
An R primer for SQL folks
 
Advanced Data Analytics with R Programming.ppt
Advanced Data Analytics with R Programming.pptAdvanced Data Analytics with R Programming.ppt
Advanced Data Analytics with R Programming.ppt
 
17641.ppt
17641.ppt17641.ppt
17641.ppt
 
Slides on introduction to R by ArinBasu MD
Slides on introduction to R by ArinBasu MDSlides on introduction to R by ArinBasu MD
Slides on introduction to R by ArinBasu MD
 
17641.ppt
17641.ppt17641.ppt
17641.ppt
 
Introduction to R Programming
Introduction to R ProgrammingIntroduction to R Programming
Introduction to R Programming
 
Essentials of R
Essentials of REssentials of R
Essentials of R
 
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
 
Research paper presentation
Research paper presentation Research paper presentation
Research paper presentation
 
Basic Analytic Techniques - Using R Tool - Part 1
Basic Analytic Techniques - Using R Tool - Part 1Basic Analytic Techniques - Using R Tool - Part 1
Basic Analytic Techniques - Using R Tool - Part 1
 
Data Analytics with R and SQL Server
Data Analytics with R and SQL ServerData Analytics with R and SQL Server
Data Analytics with R and SQL Server
 
R training at Aimia
R training at AimiaR training at Aimia
R training at Aimia
 

Recently uploaded

MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 

Recently uploaded (20)

MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 

PPT - Introduction to R.pdf

  • 1. Introduction to R • Statistics is a collection of tools used for converting raw data into information to help decision makers in their work. • Types of Statistics: Descriptive statistics is devoted to the summarization and description of data. Inferential statistics uses sample data to make an inference about a population.
  • 2. Statistical Analysis of Data using R • Statistical Software Packages 1) SAS 2) SPSS 3) STATA 4) Microsoft Excel 5) R
  • 3. Introduction to R • R Language: In 1991, R was created by Ross Ihaka and Robert Gentleman in the Department of Statistics at the University of Auckland. In 1993 the first announcement of R was made to the public. • In 2000 R version 1.0.0 was released to the public. • Philosophy – ‘How to Make Data Analysis Easier’ • The primary R system is available from the Comprehensive R Archive Network, also known as CRAN. • The main source code archives are maintained by a dedicated group known as the R Core Team http://cran.r-project.org
  • 4. Introduction to R • Installation – R GUI Search “download R”. Go to https://cran.r-project.org/bin/windows/base/ Click on Download R 4.1.1 for Windows (84 megabytes, 32/64 bit) Save the file and run as administrator. Accept all default setting for installation and complete installation process. • There is also an integrated development environment (IDE) available for R that is built by RStudio.
  • 5. Introduction to R • Installation – RStudio Search “download RStudio”. Go to https://rstudio.com/products/rstudio/download/ Click on First option RStudio Desktop (FREE) to download Save the file and run as administrator. Accept all default setting for installation and complete installation process. • Set your working directory, which lets R know where to find all of your files.
  • 6. Introduction to R • Panels of RStudio The source editor and data viewer panel The R console The command history and workspace browser The file, help, package, and plots panel Rstudio IDE: Cheat Sheet R scripts – .R extension
  • 8. Statistical Analysis of Data using R • Using Packages :- • R packages (or libraries) are collections of code that hold data and functionality used in R. (i) Installed and automatically loaded, (ii) installed but need to activate, (iii) Require to install • install.packages("arules") and update.packages() , citation citation(“arules”) • Writing own packages -- Writing R Extensions manual • Wickham, H. (2015b). R Packages. O’Reilly Media, USA. • The R Journal - https://journal.r-project.org/
  • 9. Introduction to R • Initial Codes • Function/operator Brief description options Set various R options # A comment (ignored by interpreter) getwd Print current working directory setwd Set current working directory library Load an installed package install.packages Download and install package update.packages Update installed packages help or ? Function/object help file help.search or ?? Search help files q Quit R
  • 10. Statistical Analysis of Data using R • The basics of simple arithmetic, assignment, and important object types such as vectors, matrices, lists, and data frames. • Functions, loops and conditional statements, which are used to control the flow, repetition, and execution of ‘your code’. • Elementary summary statistics such as the mean, variance, quantiles, and correlation • Visually explore your data (with both built-in and ggplot2 functionality) by using and customizing common statistical plots such as histograms and box- and-whisker plots. • R implementation and statistical interpretation of some common probability distributions.
  • 11. Statistical Analysis of Data using R • Sampling distributions and confidence intervals • hypothesis testing and p-values and demonstrates implementation and interpretation using R; the common ANOVA • Linear regression modeling • ??
  • 12. Statistical Analysis of Data using R • R Language: • Data Objects: Vector, List, Matrix, Data Frame • Data Types: Integer, Numeric (Real Numbers), Logical (True/False), Character, Complex • R Packages: R Packages are collections of R functions, data, and compiled code. It will facilitate to allow specialized statistical techniques, graphical device (such as ggplot2) Ex:- stats, dplyr Currently, the CRAN package repository features 16052 available packages
  • 13. Statistical Analysis of Data using R • Importing Data in R: The most common way is using read.table() function (.txt). Quite often we have comma (,) separated data values. Such a data file can be imported into R using read.csv(). read.csv(file, header = TRUE, sep = ",", quote = """, dec = ".", ...) Use read.table() or read.csv() function to import the file into R • Importing an Excel File: Download readxl package from CRAN. Load it in the workspace and use read_excel() function to import excel file into R. • data()
  • 14. Statistical Analysis of Data using R • Objectives Entering the Input and Evaluation Creating Vectors – The c() function can be used to create vectors of objects by concatenating things together. Finding descriptive measures like range, averages, variation (CV), five-number and summary, dotplot and boxplot diagram Perform t-test Discrete Frequency Distribution and graphs Creating Matrix – The matrix() function is used (AP) •
  • 15. Statistical Analysis of Data using R • Objectives Compute Binomial distribution, Poisson distribution and Normal distribution Probability Read data from external source using read.csv Perform Cluster Analysis Obtain Summary , Tables and Graphs Manage dataframe using dplyr package •