SlideShare a Scribd company logo
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

Introduction to R
Introduction to RIntroduction to R
Introduction to R
AvinabaMukherjee6
 
R Course Online
R Course OnlineR Course Online
R Course Online
bestonlinecoursescoupon
 
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.NET
Jaya Kumari
 
1_Introduction.pptx
1_Introduction.pptx1_Introduction.pptx
1_Introduction.pptx
ranapoonam1
 
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 lang
senthil0809
 
Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and Operators
Marwa Ali Eissa
 
Database system by VISHAL PATIL
Database system by VISHAL PATILDatabase system by VISHAL PATIL
Database system by VISHAL PATIL
Vishal Patil
 
R Programming Language
R Programming LanguageR Programming Language
R Programming Language
NareshKarela1
 
R programming
R programmingR programming
R programming
Nandhini G
 
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
Roshni814224
 
1. overview of c
1. overview of c1. overview of c
1. overview of c
amar 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].pptx
rajalakshmi5921
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
Hassan293
 
Variables & Data Types in R
Variables & Data Types in RVariables & Data Types in R
Variables & Data Types in R
Rsquared Academy
 
vb.net.pdf
vb.net.pdfvb.net.pdf
vb.net.pdf
VimalSangar1
 
Learn C# Programming - Variables & Constants
Learn C# Programming - Variables & ConstantsLearn C# Programming - Variables & Constants
Learn C# Programming - Variables & Constants
Eng Teong Cheah
 
Python - variable types
Python - variable typesPython - variable types
Python - variable types
Learnbay Datascience
 
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
croysierkathey
 

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

Data Science
Data ScienceData Science
Data Science
AvinabaMukherjee6
 
SAS Frequency Table
SAS Frequency TableSAS Frequency Table
SAS Frequency Table
AvinabaMukherjee6
 
SAS Creating List Report
SAS Creating List ReportSAS Creating List Report
SAS Creating List Report
AvinabaMukherjee6
 
Hypothesis.pptx
Hypothesis.pptxHypothesis.pptx
Hypothesis.pptx
AvinabaMukherjee6
 
SAS Defined Format.pptx
SAS Defined Format.pptxSAS Defined Format.pptx
SAS Defined Format.pptx
AvinabaMukherjee6
 
SAS Tutorial: Merging SAS Datasets
SAS Tutorial: Merging SAS DatasetsSAS Tutorial: Merging SAS Datasets
SAS Tutorial: Merging SAS Datasets
AvinabaMukherjee6
 
SAS Tutorial Sorting Data.pptx
SAS Tutorial Sorting Data.pptxSAS Tutorial Sorting Data.pptx
SAS Tutorial Sorting Data.pptx
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

一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
enxupq
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP
 
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
ahzuo
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
ewymefz
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
ocavb
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Boston Institute of Analytics
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
John Andrews
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
NABLAS株式会社
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
axoqas
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
balafet
 
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
AbhimanyuSinha9
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
ewymefz
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
ahzuo
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
jerlynmaetalle
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
v3tuleee
 
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
pchutichetpong
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
TravisMalana
 
社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .
NABLAS株式会社
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Subhajit Sahu
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
slg6lamcq
 

Recently uploaded (20)

一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
 
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
 
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
 
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
 
社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
 

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