1.Introduction to R
1.Introduction to R
Leguma Bakari
Email: [email protected]
Email: [email protected]
Phone:+255 762 760 095
February 20, 2024
Eastern Africa Statistical Training Center (EASTC)
1
Outline
1 Introduction
R and Rstudio Definitions
R and RStudio Installation
RStudio Interface
2 Why Use R?
3 Data Operators in R
4 R Comments
5 Data Types and Variables
2
Outline
1 Introduction
R and Rstudio Definitions
R and RStudio Installation
RStudio Interface
2 Why Use R?
3 Data Operators in R
4 R Comments
5 Data Types and Variables
3
R Software Definition
1 Introduction
R and Rstudio Definitions
R and RStudio Installation
RStudio Interface
2 Why Use R?
3 Data Operators in R
4 R Comments
5 Data Types and Variables
7
R and RStudio Installation
8
Outline
1 Introduction
R and Rstudio Definitions
R and RStudio Installation
RStudio Interface
2 Why Use R?
3 Data Operators in R
4 R Comments
5 Data Types and Variables
9
The interface of RStudio
When you open R Studio for the first time, you should see the
following interface:
10
Console
11
R Scripts
1 Introduction
R and Rstudio Definitions
R and RStudio Installation
RStudio Interface
2 Why Use R?
3 Data Operators in R
4 R Comments
5 Data Types and Variables
15
Why Use R?
16
Important Tips for R Beginners
17
Outline
1 Introduction
R and Rstudio Definitions
R and RStudio Installation
RStudio Interface
2 Why Use R?
3 Data Operators in R
4 R Comments
5 Data Types and Variables
18
Data Operators in R
i Arithmetic Operators
ii Assignment Operators
iii Relational Operators
iv Logical Operators
v Special Operators
19
Arithmetic Operators
20
Assignment Operators
21
Relational (Conditional) Operators
22
Logical Operators
Three symbols are the famous one for logical operators for AND,OR
and NOT (negation)
23
Special Operators
24
Outline
1 Introduction
R and Rstudio Definitions
R and RStudio Installation
RStudio Interface
2 Why Use R?
3 Data Operators in R
4 R Comments
5 Data Types and Variables
25
R Comments
1 Introduction
R and Rstudio Definitions
R and RStudio Installation
RStudio Interface
2 Why Use R?
3 Data Operators in R
4 R Comments
5 Data Types and Variables
27
Data Types and Variables
28
• The frequently used ones are
i Vectors
ii Matrices
iii Arrays
iv Factors
v Lists
vi Data Frames
vii Date
• The simplest of these objects is the vector object and there are six
data types of these atomic vectors, also termed as six classes of
vectors.
• These atomic vectors includes Logical, Numeric, Integer,
Complex, Character, and Raw
29
Outline
1 Introduction
R and Rstudio Definitions
R and RStudio Installation
RStudio Interface
2 Why Use R?
3 Data Operators in R
4 R Comments
5 Data Types and Variables
30
Frequently Used Functions
31