SlideShare a Scribd company logo
R for Beginners
with applications
Lesson 1:
Overview
first installation of R
basic operations from command line
R Studio - Visual Studio Code
First program
Packages
Write code from scratch and use
basic packages in a clear &
concise way, to do math and
statistics analysis.
From beginners to intermediate.
Abdesselam Filali 2025-05-17 18h00 Algiers time
1.
Overview of Rlang
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Overview
Overview of Rlang
R is a programming language for statistical computing and data visualization. It has been
adopted in the fields of data mining, bioinformatics and data analysis.
Presented by Abdesselam Filali - 2025-05-17
Giorgi, Federico M.; Ceraolo, Carmine; Mercatelli, Daniele (27 April 2022). "The R Language
: An Engine for Bioinformatics and Data Science". Life. 12 (5): 648.
The core R language is augmented by a large number of extension packages, containing
reusable code, documentation, and sample data.
R software is open-source and free software. R is a GNU Project and licensed under the GNU
General Public License.[3][10] It's written primarily in C, Fortran, and R itself. Precompiled
executables are provided for various operating systems.
As an interpreted language, R has a native command line interface. Moreover, multiple third-
party graphical user interfaces are available, such as Rstudio and Visual Studio Code —an
integrated development environment—, Jupyter—a notebook interface.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
History
Overview of Rlang
R was started by professors Ross Ihaka and Robert Gentleman as a programming language
to teach introductory statistics at the University of Auckland. The language was inspired by
the S programming language, with most S programs able to run unaltered in R. The
language was also inspired by Scheme's lexical scoping (lisp).
Presented by Abdesselam Filali - 2025-05-17
Ross Ihaka
co-originator of R
Robert Gentleman
https://en.wikipedia.org/wiki/R_(programming_language)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
packages
Overview of Rlang
R packages are extensions to the R statistical programming language. R packages contain
code, data, and documentation in a standardised collection format that can be installed by
users of R, typically via a centralised software repository such as CRAN (the Comprehensive
R Archive Network). The large number of packages available for R, and the ease of
installing and using them, has been cited as a major factor driving the widespread
adoption of the language in data science.
Presented by Abdesselam Filali - 2025-05-17
https://en.wikipedia.org/wiki/R_package
Base packages are immediately available when starting R and provide the necessary syntax
and commands for programming, computing, graphics production, basic arithmetic, and
statistical functionality.[
The Comprehensive R Archive Network (CRAN) was founded in 1997 by Kurt Hornik and
Friedrich Leisch to host R's source code, executable files, documentation, and user-created
packages.[21] Its name and scope mimic the Comprehensive TeX Archive Network
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Why use R ?
Overview of Rlang
• It is a great resource for data analysis, data visualization, data science and machine
learning
Presented by Abdesselam Filali - 2025-05-17
• It provides many statistical techniques (such as statistical tests, classification, clustering
and data reduction)
• It is easy to draw graphs in R, like pie charts, histograms, box plot, scatter plot, etc++
• It works on different platforms (Windows, Mac, Linux)
• It is open-source and free
• It has a large community support
• It has many packages (libraries of functions) that can be used to solve different
problems.
2.
first installation of R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Downloading R
First installation of R
Presented by Abdesselam Filali - 2025-05-17
https://posit.co/download/rstudio-desktop/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Downloading R
First installation of R
Presented by Abdesselam Filali - 2025-05-17
Go to https://cran.rstudio.com/index.html
download and install R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Downloading R
First installation of R
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Installing R
First installation of R
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Installing R
First installation of R
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Installing R
First installation of R
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Installing R
First installation of R
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Installing R
First installation of R
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Installing R
First installation of R
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Running RGui
First use of R
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Installing R
First installation of R
Windows + X or left clic on the start button
System  Advanced system settings
https://www.computerhope.com/issues/ch000549.htm
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Installing R
First installation of R
Environment Variables
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Installing R
First installation of R
Path Edit
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Installing R
First installation of R
New
C:Program FilesRR-4.5.0bin
Presented by Abdesselam Filali - 2025-05-17
3.
basic operations from command
line
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Running R in terminal
First use of R
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Installing R
First installation of R
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Installing R
First installation of R
Presented by Abdesselam Filali - 2025-05-17
4.
R Studio - Visual Studio Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Running RStudio
First use of RStudio
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Running RStudio
First use of RStudio
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Running RStudio
First use of RStudio
Presented by Abdesselam Filali - 2025-05-17
5.
first program
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Running RStudio
First use of RStudio
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Variable names
First program
Presented by Abdesselam Filali - 2025-05-17
A variable can have a short name (like x and y) or a more descriptive name (age, carname,
total_volume). Rules for R variables are:
• A variable name must start with a letter and can be a combination of letters, digits,
period(.)
and underscore(_). If it starts with period(.), it cannot be followed by a digit.
• A variable name cannot start with a number or underscore (_)
• Variable names are case-sensitive (age, Age and AGE are three different variables)
• Reserved words cannot be used as variables (TRUE, FALSE, NULL, if...)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Variable names
First program
Presented by Abdesselam Filali - 2025-05-17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Variable names
First program
Presented by Abdesselam Filali - 2025-05-17
In R, variables do not need to be declared with any particular type, and can even change
type after they have been set:
R has a variety of data types and object classes. You will learn much more about these as
you continue to get to know R.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Basic data Types
First program
Presented by Abdesselam Filali - 2025-05-17
Basic data types in R can be divided into the following types:
numeric - (10.5, 55, 787)
integer - (1L, 55L, 100L, where the letter "L" declares this as an integer)
complex - (9 + 3i, where "i" is the imaginary part)
character (a.k.a. string) - ("k", "R is exciting", "FALSE", "11.5")
logical (a.k.a. boolean) - (TRUE or FALSE)
We can use the class() function to check the data type of a variable:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Basic data Types
First program
Presented by Abdesselam Filali - 2025-05-17
There are three number types in R:
- numeric
- integer
- complex
Variables of number types are created when you assign a value to them.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Basic data Types
First program
Presented by Abdesselam Filali - 2025-05-17
numeric
A numeric data type is the most common type in R, and contains any number with or without a
decimal, like: 10.5, 55, 787:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Basic data Types
First program
Presented by Abdesselam Filali - 2025-05-17
integer
Integers are numeric data without decimals. This is used when you are certain that you will
never create a variable that should contain decimals. To create an integer variable, you must
use the letter L after the integer value:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Basic data Types
First program
Presented by Abdesselam Filali - 2025-05-17
Complex
A complex number is written with an "i" as the imaginary part:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Type conversion
First program
Presented by Abdesselam Filali - 2025-05-17
You can convert from one type to another with the following functions:
as.numeric()
as.integer()
as.complex()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Doing Math
First program
Presented by Abdesselam Filali - 2025-05-17
You can convert from one type to another with the following functions:
as.numeric()
as.integer()
as.complex()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
operators
First program
Presented by Abdesselam Filali - 2025-05-17
R divides the operators in the following groups:
Arithmetic operators
Assignment operators
Comparison operators
Logical operators
Miscellaneous operators
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Arethmetic operators
First program
Presented by Abdesselam Filali - 2025-05-17
Arithmetic operators are used with numeric values to perform common mathematical
operations:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Comparaison operators
First program
Presented by Abdesselam Filali - 2025-05-17
Comparison operators are used to compare two values:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Logical operators
First program
Presented by Abdesselam Filali - 2025-05-17
Logical operators are used to combine conditional statements:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Miscellaneous Operators
First program
Presented by Abdesselam Filali - 2025-05-17
Miscellaneous operators are used to manipulate data:
5.
packages
48
Thank you for your attention

More Related Content

Similar to R for Beginners with applications 1 R for Beginners with applications 1 (20)

PDF
Study of R Programming
IRJET Journal
 
PPTX
R programming language
Keerti Verma
 
PPTX
Reason To learn & use r
Septian Pratama Rusmana
 
PDF
Data Science - Part II - Working with R & R studio
Derek Kane
 
PDF
Unit1_Introduction to R.pdf
MDDidarulAlam15
 
PPTX
R Programming Language
NareshKarela1
 
PPTX
R programming
Pooja Sharma
 
PPTX
1_Introduction.pptx
ranapoonam1
 
PPTX
R basics for MBA Students[1].pptx
rajalakshmi5921
 
PPTX
Financial Risk Mgt - Lec 1 by dr. syed muhammad ali tirmizi
Dr. Muhammad Ali Tirmizi., Ph.D.
 
PDF
R-Language-Lab-Manual-lab-1.pdf
DrGSakthiGovindaraju
 
PDF
R-Language-Lab-Manual-lab-1.pdf
KabilaArun
 
PDF
R-Language-Lab-Manual-lab-1.pdf
attalurilalitha
 
PPTX
DATA MINING USING R (1).pptx
myworld93
 
PDF
Introduction To R
Spotle.ai
 
PPTX
R programming Language , Rahul Singh
Ravi Basil
 
PPTX
R programming presentation
Akshat Sharma
 
PPTX
R programming
Shantanu Patil
 
PDF
UNIT-4 Start Learning R and installation .pdf
geethar79
 
PDF
2 it unit-1 start learning r
Netaji Gandi
 
Study of R Programming
IRJET Journal
 
R programming language
Keerti Verma
 
Reason To learn & use r
Septian Pratama Rusmana
 
Data Science - Part II - Working with R & R studio
Derek Kane
 
Unit1_Introduction to R.pdf
MDDidarulAlam15
 
R Programming Language
NareshKarela1
 
R programming
Pooja Sharma
 
1_Introduction.pptx
ranapoonam1
 
R basics for MBA Students[1].pptx
rajalakshmi5921
 
Financial Risk Mgt - Lec 1 by dr. syed muhammad ali tirmizi
Dr. Muhammad Ali Tirmizi., Ph.D.
 
R-Language-Lab-Manual-lab-1.pdf
DrGSakthiGovindaraju
 
R-Language-Lab-Manual-lab-1.pdf
KabilaArun
 
R-Language-Lab-Manual-lab-1.pdf
attalurilalitha
 
DATA MINING USING R (1).pptx
myworld93
 
Introduction To R
Spotle.ai
 
R programming Language , Rahul Singh
Ravi Basil
 
R programming presentation
Akshat Sharma
 
R programming
Shantanu Patil
 
UNIT-4 Start Learning R and installation .pdf
geethar79
 
2 it unit-1 start learning r
Netaji Gandi
 

Recently uploaded (20)

PPTX
ROLE OF ANTIOXIDANT IN EYE HEALTH MANAGEMENT.pptx
Subham Panja
 
PPTX
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
PPTX
Accounting Skills Paper-I, Preparation of Vouchers
Dr. Sushil Bansode
 
PDF
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
PDF
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PDF
The-Beginnings-of-Indian-Civilisation.pdf/6th class new ncert social/by k san...
Sandeep Swamy
 
PPTX
CONVULSIVE DISORDERS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PPTX
Nutri-QUIZ-Bee-Elementary.pptx...................
ferdinandsanbuenaven
 
PDF
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
PPTX
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPTX
PPT on the Development of Education in the Victorian England
Beena E S
 
PDF
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
PPTX
SCHOOL-BASED SEXUAL HARASSMENT PREVENTION AND RESPONSE WORKSHOP
komlalokoe
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPTX
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PPTX
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
ROLE OF ANTIOXIDANT IN EYE HEALTH MANAGEMENT.pptx
Subham Panja
 
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
Accounting Skills Paper-I, Preparation of Vouchers
Dr. Sushil Bansode
 
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
The-Beginnings-of-Indian-Civilisation.pdf/6th class new ncert social/by k san...
Sandeep Swamy
 
CONVULSIVE DISORDERS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
Nutri-QUIZ-Bee-Elementary.pptx...................
ferdinandsanbuenaven
 
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPT on the Development of Education in the Victorian England
Beena E S
 
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
SCHOOL-BASED SEXUAL HARASSMENT PREVENTION AND RESPONSE WORKSHOP
komlalokoe
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
Ad

R for Beginners with applications 1 R for Beginners with applications 1