SlideShare a Scribd company logo
1 of 8
R Programming
Handson School of Data Science, Management & Technology
www.handsonsystem.com 1
Outline the main topics :
Define variables and their
importance in programming.
www.handsonsystem.com 2
Explain how to assign values to variables
in R using the assignment operator "<-".
Discuss the rules and best practices
for naming variables in R.
Highlight the importance of choosing
meaningful and descriptive names.
In R programming, variables are used to store and
manipulate data. A variable can be thought of as a named
container that holds a value. Variables provide a way to
refer to and work with data in your programs.
Variables in R can hold different types of data, such as
numeric values, character strings, logical values, and
more. The type of data stored in a variable determines its
data type. R is a dynamically typed language, which
means that the data type of a variable is inferred based
on the value assigned to it.
You can also update the value of a variable by
reassigning it using the assignment operator.
www.handsonsystem.com 3
The print() function is then used to display the value of
the variable
www.handsonsystem.com 4
They play a crucial role in programming as they allow us to store values and perform operations on them. In R,
we can assign values to variables using the assignment operator "<-". For example, x <- 10 assigns the
value 10 to the variable x, and y <- "Hello, World!" assigns the string "Hello, World!" to the variable
y.
Variable Naming Conventions
Discuss the rules and best practices for naming variables in R
When naming variables in R, it's important to follow certain rules and best practices. Here are
some guidelines:
•Variable names should start with a letter and can be followed by letters, digits, or periods.
•Avoid using reserved words or function names as variable names.
•Use descriptive names that convey the purpose or meaning of the variable.
•Variable names are case-sensitive, so age and Age are considered different variables.
www.handsonsystem.com 5
CHART SLIDE
www.handsonsystem.com 6
Valid variable names
Output
20XX
# Valid variable names
age <- 25
first_name <- "John"
is_student <- TRUE
CHART SLIDE
www.handsonsystem.com 7
Inalid variable names
Output
20XX
# Invalid variable names (starting with a
number) 2nd_place <- "Second"
THANK
YOU!
Handson School of Data
Science, Management &
Technology.
+91 9830 24 7087
www.handsonsystem.com
info@handsonsystem.com
www.handsonsystem.com 8

More Related Content

Similar to R Programming: Variable

C presentation! BATRA COMPUTER CENTRE
C presentation! BATRA  COMPUTER  CENTRE C presentation! BATRA  COMPUTER  CENTRE
C presentation! BATRA COMPUTER CENTRE jatin batra
 
Variable and constants in Vb.NET
Variable and constants in Vb.NETVariable and constants in Vb.NET
Variable and constants in Vb.NETJaya Kumari
 
1_Introduction.pptx
1_Introduction.pptx1_Introduction.pptx
1_Introduction.pptxranapoonam1
 
4. SQL in DBMS
4. SQL in DBMS4. SQL in DBMS
4. SQL in DBMSkoolkampus
 
Get started with R lang
Get started with R langGet started with R lang
Get started with R langsenthil0809
 
Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and OperatorsMarwa Ali Eissa
 
Database system by VISHAL PATIL
Database system by VISHAL PATILDatabase system by VISHAL PATIL
Database system by VISHAL PATILVishal Patil
 
R Programming Language
R Programming LanguageR Programming Language
R Programming LanguageNareshKarela1
 
relational model in Database Management.ppt.ppt
relational model in Database Management.ppt.pptrelational model in Database Management.ppt.ppt
relational model in Database Management.ppt.pptRoshni814224
 
1. overview of c
1. overview of c1. overview of c
1. overview of camar kakde
 
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].pptxrajalakshmi5921
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming FundamentalsHassan293
 
Variables & Data Types in R
Variables & Data Types in RVariables & Data Types in R
Variables & Data Types in RRsquared Academy
 
Learn C# Programming - Variables & Constants
Learn C# Programming - Variables & ConstantsLearn C# Programming - Variables & Constants
Learn C# Programming - Variables & ConstantsEng Teong Cheah
 
MaciasWinter 2020ENG 107Project #2A Year in Gami.docx
MaciasWinter 2020ENG 107Project #2A Year in Gami.docxMaciasWinter 2020ENG 107Project #2A Year in Gami.docx
MaciasWinter 2020ENG 107Project #2A Year in Gami.docxcroysierkathey
 

Similar to R Programming: Variable (20)

Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
R Course Online
R Course OnlineR Course Online
R Course Online
 
C presentation! BATRA COMPUTER CENTRE
C presentation! BATRA  COMPUTER  CENTRE C presentation! BATRA  COMPUTER  CENTRE
C presentation! BATRA COMPUTER CENTRE
 
Variable and constants in Vb.NET
Variable and constants in Vb.NETVariable and constants in Vb.NET
Variable and constants in Vb.NET
 
1_Introduction.pptx
1_Introduction.pptx1_Introduction.pptx
1_Introduction.pptx
 
4. SQL in DBMS
4. SQL in DBMS4. SQL in DBMS
4. SQL in DBMS
 
Get started with R lang
Get started with R langGet started with R lang
Get started with R lang
 
Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and Operators
 
Database system by VISHAL PATIL
Database system by VISHAL PATILDatabase system by VISHAL PATIL
Database system by VISHAL PATIL
 
R Programming Language
R Programming LanguageR Programming Language
R Programming Language
 
R programming
R programmingR programming
R programming
 
relational model in Database Management.ppt.ppt
relational model in Database Management.ppt.pptrelational model in Database Management.ppt.ppt
relational model in Database Management.ppt.ppt
 
1. overview of c
1. overview of c1. overview of c
1. overview of c
 
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
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Variables & Data Types in R
Variables & Data Types in RVariables & Data Types in R
Variables & Data Types in R
 
vb.net.pdf
vb.net.pdfvb.net.pdf
vb.net.pdf
 
Learn C# Programming - Variables & Constants
Learn C# Programming - Variables & ConstantsLearn C# Programming - Variables & Constants
Learn C# Programming - Variables & Constants
 
Python - variable types
Python - variable typesPython - variable types
Python - variable types
 
MaciasWinter 2020ENG 107Project #2A Year in Gami.docx
MaciasWinter 2020ENG 107Project #2A Year in Gami.docxMaciasWinter 2020ENG 107Project #2A Year in Gami.docx
MaciasWinter 2020ENG 107Project #2A Year in Gami.docx
 

More from AvinabaMukherjee6

More from AvinabaMukherjee6 (7)

Data Science
Data ScienceData Science
Data Science
 
SAS Frequency Table
SAS Frequency TableSAS Frequency Table
SAS Frequency Table
 
SAS Creating List Report
SAS Creating List ReportSAS Creating List Report
SAS Creating List Report
 
Hypothesis.pptx
Hypothesis.pptxHypothesis.pptx
Hypothesis.pptx
 
SAS Defined Format.pptx
SAS Defined Format.pptxSAS Defined Format.pptx
SAS Defined Format.pptx
 
SAS Tutorial: Merging SAS Datasets
SAS Tutorial: Merging SAS DatasetsSAS Tutorial: Merging SAS Datasets
SAS Tutorial: Merging SAS Datasets
 
SAS Tutorial Sorting Data.pptx
SAS Tutorial Sorting Data.pptxSAS Tutorial Sorting Data.pptx
SAS Tutorial Sorting Data.pptx
 

Recently uploaded

VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
Predicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project PresentationPredicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project PresentationBoston Institute of Analytics
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...Suhani Kapoor
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service LucknowAminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknowmakika9823
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一ffjhghh
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 

Recently uploaded (20)

VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
Predicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project PresentationPredicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project Presentation
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
VIP High Class Call Girls Bikaner Anushka 8250192130 Independent Escort Servi...
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service LucknowAminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
Aminabad Call Girl Agent 9548273370 , Call Girls Service Lucknow
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
Decoding Loan Approval: Predictive Modeling in Action
Decoding Loan Approval: Predictive Modeling in ActionDecoding Loan Approval: Predictive Modeling in Action
Decoding Loan Approval: Predictive Modeling in Action
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 

R Programming: Variable

  • 1. R Programming Handson School of Data Science, Management & Technology www.handsonsystem.com 1
  • 2. Outline the main topics : Define variables and their importance in programming. www.handsonsystem.com 2 Explain how to assign values to variables in R using the assignment operator "<-". Discuss the rules and best practices for naming variables in R. Highlight the importance of choosing meaningful and descriptive names.
  • 3. In R programming, variables are used to store and manipulate data. A variable can be thought of as a named container that holds a value. Variables provide a way to refer to and work with data in your programs. Variables in R can hold different types of data, such as numeric values, character strings, logical values, and more. The type of data stored in a variable determines its data type. R is a dynamically typed language, which means that the data type of a variable is inferred based on the value assigned to it. You can also update the value of a variable by reassigning it using the assignment operator. www.handsonsystem.com 3 The print() function is then used to display the value of the variable
  • 4. www.handsonsystem.com 4 They play a crucial role in programming as they allow us to store values and perform operations on them. In R, we can assign values to variables using the assignment operator "<-". For example, x <- 10 assigns the value 10 to the variable x, and y <- "Hello, World!" assigns the string "Hello, World!" to the variable y.
  • 5. Variable Naming Conventions Discuss the rules and best practices for naming variables in R When naming variables in R, it's important to follow certain rules and best practices. Here are some guidelines: •Variable names should start with a letter and can be followed by letters, digits, or periods. •Avoid using reserved words or function names as variable names. •Use descriptive names that convey the purpose or meaning of the variable. •Variable names are case-sensitive, so age and Age are considered different variables. www.handsonsystem.com 5
  • 6. CHART SLIDE www.handsonsystem.com 6 Valid variable names Output 20XX # Valid variable names age <- 25 first_name <- "John" is_student <- TRUE
  • 7. CHART SLIDE www.handsonsystem.com 7 Inalid variable names Output 20XX # Invalid variable names (starting with a number) 2nd_place <- "Second"
  • 8. THANK YOU! Handson School of Data Science, Management & Technology. +91 9830 24 7087 www.handsonsystem.com info@handsonsystem.com www.handsonsystem.com 8