際際滷

際際滷Share a Scribd company logo
R Data Structures
WMG Training
Sept 2016
National Environmental Standards and Regulations Enforcement Agency
(NESREA)
Facilitator: Victor Ordu
Source: H Wickham (2014). Advanced R. Chapman & Hall, Boca Raton. http://adv-r.had.co.nz/
Recap
Recap
 Caveat
 Not everything I will tell you will be 100% correct
 Why?
 Stupid mistakes
 Updates
 New knowledge
 Multiple approaches, some better than others
 Continuous learning
 Moral: commit to personal growth
Notation
 Regular text with look like this
 Highlighted items will look like this
 this <- R_code(will look like)
Types of Data Structures
1. Vectors
2. Data frames
3. Matrices
4. Lists
5. Arrays
Types of Data Structures
1. Vectors
2. Data frames
3. Matrices
4. Lists
5. Arrays
R Data Structures (Part 1)
Kinds of Vectors
 Six (6) kinds:
1. Character
2. Integer
3. Double (or numeric)
4. Logical
Vectors
 Common characteristics
 All elements are of a particular data type (in lay
language, type would be numbers, words, etc.)
 One-dimensional
 The lowest vector is of length 1
 The largest  well, depends on the .Machine
Making vectors
 By assignment
 The concatenate function
 Latin: con  caten  atus (chain)
 Some call it combine function
 Indispensible in creating vectors
 You can grow a vector
 You may ask how, much, much, much, much later
 Character vectors
 Strings are always placed in quotation marks when
coding i.e. boy, NESREA, R is easy to
learn, A string can be a whole
sentence!, 9.
 Some character vectors are inbuilt into R e.g.
letters, LETTERS, month.abb, month.name
 Remember use quotation marks:   or  .
 We can create empty vectors with specific lengths e.g.
character(length = 10) or character(10)
 Limit approx. 231 (about 2 billion)
characters!
 Exercise
 Start a clean slate with rm(list = ls())
 Make a character vector Name containing full names
(both Surname and Given Name) of 10 adults
 Make a second vector Facility of names of 10
facilities (imaginary, please!)
 Use typeof() to check what type of vector Name is
 Confirm the type of Facility using
is.character()
 Note: We can use as.character() to convert
another vector to a character vector.
 Integer vectors
 1L, 2L, 3L
 Why the L?
 Not numerical per se
 Wide range  max up to 2,147,483,647
 Exercise
 Make an integer vector Age of 10 adult subjects
 Make an integer vector StaffStrength for 10 facilities
 Numeric (double) vectors
 These are real numbers
 Story of the term double
 Some numeric vectors are inbuilt  mathematical
constants e.g. pi, exp(1),
 Logical vectors
 TRUE/FALSE (not true/false); T/F
 Zero is FALSE; any non-zero is TRUE
 Exercise
 Make a logical vector PermitSighted for 10 facilities.
 Make another one usingPPE for 10 individuals.
 Use str(), typeof(), is.logical(), to explore them.
Stats brief
 Types of variables
 Quantitative
 Qualitative
 Levels of measurement
 Nominal
 Ordinal
 Interval
 Ratio
Factors
 Integer values that are mapped to strings
 Used to represent categorical data
 Each category is called a level
 One of the most powerful uses of R
 Exercise
 Make a vector industryType using 3 categories  small,
medium, large  for 10 facilities only.
 Make a factor industryCategory by calling the function
factor() on industryType.
 Now use typeof(), is.factor, is.character,
is.integer() to review these 2 objects.
Things to note
 Legal names
 Coercion
 Limits
 Common mistakes
 Confusing factors with characters
Homogenous Heterogeneous
1-dimension Atomic vectors Lists
2-dimensions Matrices Data frames
N-dimensions Arrays
> R toolbox
 help() or ?
 getwd(); setwd()
 ls()
 rm()
 save(); load()
> R toolbox
 An example  ls()
 Its relatively easy to see all the objects at a glance
 Note that this function is called without any
arguments
> R toolbox
 But how do you deal with this?
Long list beyond screen
> R toolbox
 Extend use of functions by defining other
parameters (optional)
 Use ? to learn about a functions uses &
arguments
 When more familiar, use others like args()
> R toolbox
Types of Data Structures
1. Vectors
2. Data frames
3. Matrices
4. Lists
5. Arrays

More Related Content

What's hot (20)

Introduction To Data Structures.
Introduction To Data Structures.Introduction To Data Structures.
Introduction To Data Structures.
Education Front
Data Structure # vpmp polytechnic
Data Structure # vpmp polytechnicData Structure # vpmp polytechnic
Data Structure # vpmp polytechnic
lavparmar007
Pandas
PandasPandas
Pandas
Dr. Chitra Dhawale
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHIBCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
Sowmya Jyothi
Introduction to Data Structure part 1
Introduction to Data Structure part 1Introduction to Data Structure part 1
Introduction to Data Structure part 1
ProfSonaliGholveDoif
Arrays in C
Arrays in CArrays in C
Arrays in C
sangrampatil81
Arrays declartion and initialization
Arrays declartion and initializationArrays declartion and initialization
Arrays declartion and initialization
sangrampatil81
Files and data storage
Files and data storageFiles and data storage
Files and data storage
Zaid Shabbir
BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI
BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHIBCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI
BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI
Sowmya Jyothi
Introduction of data structures and algorithms
Introduction of data structures and algorithmsIntroduction of data structures and algorithms
Introduction of data structures and algorithms
VinayKumarV16
DATA STRUCTURE
DATA STRUCTUREDATA STRUCTURE
DATA STRUCTURE
Rohit Rai
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
Vivek Kumar Sinha
Types Of Data Structure
Types Of Data StructureTypes Of Data Structure
Types Of Data Structure
Vaishali Chinchkhede
Ii pu cs practical viva voce questions
Ii pu cs  practical viva voce questionsIi pu cs  practical viva voce questions
Ii pu cs practical viva voce questions
Prof. Dr. K. Adisesha
Data Structures - Lecture 2 [Introduction to Data Structures]
Data Structures - Lecture 2 [Introduction to Data Structures]Data Structures - Lecture 2 [Introduction to Data Structures]
Data Structures - Lecture 2 [Introduction to Data Structures]
Muhammad Hammad Waseem
Data Structure & Algorithms | Computer Science
Data Structure & Algorithms | Computer ScienceData Structure & Algorithms | Computer Science
Data Structure & Algorithms | Computer Science
Transweb Global Inc
Rdbms
RdbmsRdbms
Rdbms
renukarenuka9
How to handling strings in r
How to handling strings in rHow to handling strings in r
How to handling strings in r
Pramod Rathore
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithms
Aakash deep Singhal
Data Structures
Data StructuresData Structures
Data Structures
Prof. Dr. K. Adisesha
Introduction To Data Structures.
Introduction To Data Structures.Introduction To Data Structures.
Introduction To Data Structures.
Education Front
Data Structure # vpmp polytechnic
Data Structure # vpmp polytechnicData Structure # vpmp polytechnic
Data Structure # vpmp polytechnic
lavparmar007
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHIBCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
Sowmya Jyothi
Introduction to Data Structure part 1
Introduction to Data Structure part 1Introduction to Data Structure part 1
Introduction to Data Structure part 1
ProfSonaliGholveDoif
Arrays declartion and initialization
Arrays declartion and initializationArrays declartion and initialization
Arrays declartion and initialization
sangrampatil81
Files and data storage
Files and data storageFiles and data storage
Files and data storage
Zaid Shabbir
BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI
BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHIBCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI
BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI
Sowmya Jyothi
Introduction of data structures and algorithms
Introduction of data structures and algorithmsIntroduction of data structures and algorithms
Introduction of data structures and algorithms
VinayKumarV16
DATA STRUCTURE
DATA STRUCTUREDATA STRUCTURE
DATA STRUCTURE
Rohit Rai
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
Vivek Kumar Sinha
Ii pu cs practical viva voce questions
Ii pu cs  practical viva voce questionsIi pu cs  practical viva voce questions
Ii pu cs practical viva voce questions
Prof. Dr. K. Adisesha
Data Structures - Lecture 2 [Introduction to Data Structures]
Data Structures - Lecture 2 [Introduction to Data Structures]Data Structures - Lecture 2 [Introduction to Data Structures]
Data Structures - Lecture 2 [Introduction to Data Structures]
Muhammad Hammad Waseem
Data Structure & Algorithms | Computer Science
Data Structure & Algorithms | Computer ScienceData Structure & Algorithms | Computer Science
Data Structure & Algorithms | Computer Science
Transweb Global Inc
How to handling strings in r
How to handling strings in rHow to handling strings in r
How to handling strings in r
Pramod Rathore
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithms
Aakash deep Singhal

Similar to R Data Structures (Part 1) (20)

Introduction To Programming In R for data analyst
Introduction To Programming In R for data analystIntroduction To Programming In R for data analyst
Introduction To Programming In R for data analyst
ssuser26ff68
Introduction to R for Learning Analytics Researchers
Introduction to R for Learning Analytics ResearchersIntroduction to R for Learning Analytics Researchers
Introduction to R for Learning Analytics Researchers
Vitomir Kovanovic
Object oriented programming1 Week 1.pptx
Object oriented programming1 Week 1.pptxObject oriented programming1 Week 1.pptx
Object oriented programming1 Week 1.pptx
MirHazarKhan1
R tutorial
R tutorialR tutorial
R tutorial
Richard Vidgen
R training2
R training2R training2
R training2
Hellen Gakuruh
忰悋惷惘悸 惡惘悋悴 悋惠忰 悋 R program 惆.惆 悋惆
忰悋惷惘悸 惡惘悋悴 悋惠忰 悋   R program 惆.惆 悋惆忰悋惷惘悸 惡惘悋悴 悋惠忰 悋   R program 惆.惆 悋惆
忰悋惷惘悸 惡惘悋悴 悋惠忰 悋 R program 惆.惆 悋惆
惘慍 悋惡忰惓 悋悖愕悋 悋惺悸
Big data analytics with R tool.pptx
Big data analytics with R tool.pptxBig data analytics with R tool.pptx
Big data analytics with R tool.pptx
salutiontechnology
computer science CLASS 11 AND 12 SYLLABUS.pdf
computer science CLASS 11 AND 12 SYLLABUS.pdfcomputer science CLASS 11 AND 12 SYLLABUS.pdf
computer science CLASS 11 AND 12 SYLLABUS.pdf
SomnathSaha63
Intro to data science module 1 r
Intro to data science module 1 rIntro to data science module 1 r
Intro to data science module 1 r
amuletc
忰悋惷惘悸 惡惘悋悴 悋惠忰 悋 R program 惆.惆 悋惆
忰悋惷惘悸 惡惘悋悴 悋惠忰 悋   R program 惆.惆 悋惆忰悋惷惘悸 惡惘悋悴 悋惠忰 悋   R program 惆.惆 悋惆
忰悋惷惘悸 惡惘悋悴 悋惠忰 悋 R program 惆.惆 悋惆
惘慍 悋惡忰惓 悋悖愕悋 悋惺悸
R Programing language Notes Unit 5 Data Viz in R
R Programing language Notes Unit 5 Data Viz in RR Programing language Notes Unit 5 Data Viz in R
R Programing language Notes Unit 5 Data Viz in R
en20cs301479
05 -- Feature Engineering (Text).pptxiuy
05 -- Feature Engineering (Text).pptxiuy05 -- Feature Engineering (Text).pptxiuy
05 -- Feature Engineering (Text).pptxiuy
Sravani477269
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
Anshika865276
Basocs of statistics with R-Programming.ppt
Basocs of statistics with R-Programming.pptBasocs of statistics with R-Programming.ppt
Basocs of statistics with R-Programming.ppt
geethar79
Basics of R-Programming with example.ppt
Basics of R-Programming with example.pptBasics of R-Programming with example.ppt
Basics of R-Programming with example.ppt
geethar79
R-Programming.ppt it is based on R programming language
R-Programming.ppt it is based on R programming languageR-Programming.ppt it is based on R programming language
R-Programming.ppt it is based on R programming language
Zoha681526
Basic data analysis using R.
Basic data analysis using R.Basic data analysis using R.
Basic data analysis using R.
C. Tobin Magle
data science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdfdata science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdf
mukeshgarg02
R programming by ganesh kavhar
R programming by ganesh kavharR programming by ganesh kavhar
R programming by ganesh kavhar
Savitribai Phule Pune University
Unit I - 1R introduction to R program.pptx
Unit I - 1R introduction to R program.pptxUnit I - 1R introduction to R program.pptx
Unit I - 1R introduction to R program.pptx
SreeLaya9
Introduction To Programming In R for data analyst
Introduction To Programming In R for data analystIntroduction To Programming In R for data analyst
Introduction To Programming In R for data analyst
ssuser26ff68
Introduction to R for Learning Analytics Researchers
Introduction to R for Learning Analytics ResearchersIntroduction to R for Learning Analytics Researchers
Introduction to R for Learning Analytics Researchers
Vitomir Kovanovic
Object oriented programming1 Week 1.pptx
Object oriented programming1 Week 1.pptxObject oriented programming1 Week 1.pptx
Object oriented programming1 Week 1.pptx
MirHazarKhan1
Big data analytics with R tool.pptx
Big data analytics with R tool.pptxBig data analytics with R tool.pptx
Big data analytics with R tool.pptx
salutiontechnology
computer science CLASS 11 AND 12 SYLLABUS.pdf
computer science CLASS 11 AND 12 SYLLABUS.pdfcomputer science CLASS 11 AND 12 SYLLABUS.pdf
computer science CLASS 11 AND 12 SYLLABUS.pdf
SomnathSaha63
Intro to data science module 1 r
Intro to data science module 1 rIntro to data science module 1 r
Intro to data science module 1 r
amuletc
R Programing language Notes Unit 5 Data Viz in R
R Programing language Notes Unit 5 Data Viz in RR Programing language Notes Unit 5 Data Viz in R
R Programing language Notes Unit 5 Data Viz in R
en20cs301479
05 -- Feature Engineering (Text).pptxiuy
05 -- Feature Engineering (Text).pptxiuy05 -- Feature Engineering (Text).pptxiuy
05 -- Feature Engineering (Text).pptxiuy
Sravani477269
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
Anshika865276
Basocs of statistics with R-Programming.ppt
Basocs of statistics with R-Programming.pptBasocs of statistics with R-Programming.ppt
Basocs of statistics with R-Programming.ppt
geethar79
Basics of R-Programming with example.ppt
Basics of R-Programming with example.pptBasics of R-Programming with example.ppt
Basics of R-Programming with example.ppt
geethar79
R-Programming.ppt it is based on R programming language
R-Programming.ppt it is based on R programming languageR-Programming.ppt it is based on R programming language
R-Programming.ppt it is based on R programming language
Zoha681526
Basic data analysis using R.
Basic data analysis using R.Basic data analysis using R.
Basic data analysis using R.
C. Tobin Magle
data science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdfdata science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdf
mukeshgarg02
Unit I - 1R introduction to R program.pptx
Unit I - 1R introduction to R program.pptxUnit I - 1R introduction to R program.pptx
Unit I - 1R introduction to R program.pptx
SreeLaya9

Recently uploaded (20)

Jotform AI Agents: Real User Success Stories
Jotform AI Agents: Real User Success StoriesJotform AI Agents: Real User Success Stories
Jotform AI Agents: Real User Success Stories
Jotform
A Brief Introduction About Jeff Menashe
A Brief Introduction About  Jeff MenasheA Brief Introduction About  Jeff Menashe
A Brief Introduction About Jeff Menashe
Jeff Menashe
Lecture2_REQUIREMENT_Process__Modelss.pptx
Lecture2_REQUIREMENT_Process__Modelss.pptxLecture2_REQUIREMENT_Process__Modelss.pptx
Lecture2_REQUIREMENT_Process__Modelss.pptx
Aqsa162589
Java and AI with LangChain4j: Jakarta EE and AI
Java and AI with LangChain4j: Jakarta EE and AIJava and AI with LangChain4j: Jakarta EE and AI
Java and AI with LangChain4j: Jakarta EE and AI
Edward Burns
Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025
bibi39322
Threat Modeling & Risk Assessment Webinar: A Step-by-Step Example
Threat Modeling & Risk Assessment Webinar: A Step-by-Step ExampleThreat Modeling & Risk Assessment Webinar: A Step-by-Step Example
Threat Modeling & Risk Assessment Webinar: A Step-by-Step Example
ICS
Wondershare Democreator 8.3.3 Crack Activated Free Download
Wondershare Democreator 8.3.3 Crack Activated Free DownloadWondershare Democreator 8.3.3 Crack Activated Free Download
Wondershare Democreator 8.3.3 Crack Activated Free Download
adanataj41
Wondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free DownloadWondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free Download
anglekaan18
Oracle Database administration Security PPT
Oracle Database administration Security PPTOracle Database administration Security PPT
Oracle Database administration Security PPT
pshankarnarayan
Parallels Desktop Crack [Latest] 2025 free
Parallels Desktop Crack [Latest] 2025 freeParallels Desktop Crack [Latest] 2025 free
Parallels Desktop Crack [Latest] 2025 free
mohsinrazakpa96
Wondershare Filmora 14.3.2.11147 crack
Wondershare Filmora   14.3.2.11147 crackWondershare Filmora   14.3.2.11147 crack
Wondershare Filmora 14.3.2.11147 crack
blouch51kp
Kaspersky Lab Products Remover 1.0.5497.0
Kaspersky Lab Products Remover 1.0.5497.0Kaspersky Lab Products Remover 1.0.5497.0
Kaspersky Lab Products Remover 1.0.5497.0
mohsinrazakpa93
Jotform AI Agents: Overview and Benefits
Jotform AI Agents: Overview and BenefitsJotform AI Agents: Overview and Benefits
Jotform AI Agents: Overview and Benefits
Jotform
Top Performance Testing Tools of 2025: Ensure Speed, Stability, and Scale
Top Performance Testing Tools of 2025: Ensure Speed, Stability, and ScaleTop Performance Testing Tools of 2025: Ensure Speed, Stability, and Scale
Top Performance Testing Tools of 2025: Ensure Speed, Stability, and Scale
Shubham Joshi
Java and AI with LangChain4j: Jakarta EE gets AI
Java and AI with LangChain4j: Jakarta EE gets AIJava and AI with LangChain4j: Jakarta EE gets AI
Java and AI with LangChain4j: Jakarta EE gets AI
Edward Burns
Building-Your-Professional-Website-No-Coding-Required
Building-Your-Professional-Website-No-Coding-RequiredBuilding-Your-Professional-Website-No-Coding-Required
Building-Your-Professional-Website-No-Coding-Required
Ozias Rondon
Image-Line FL Studio 20.8.3.2304 crack free
Image-Line FL Studio 20.8.3.2304 crack freeImage-Line FL Studio 20.8.3.2304 crack free
Image-Line FL Studio 20.8.3.2304 crack free
alihamzakpa084
Making significant software architecture decisions
Making significant software architecture decisionsMaking significant software architecture decisions
Making significant software architecture decisions
Bert Jan Schrijver
IObit Driver Booster Pro 12.3.0.557 Free
IObit Driver Booster Pro 12.3.0.557 FreeIObit Driver Booster Pro 12.3.0.557 Free
IObit Driver Booster Pro 12.3.0.557 Free
blouch51kp
IObit Driver Booster Pro 12.3.0.557 Free
IObit Driver Booster Pro 12.3.0.557 FreeIObit Driver Booster Pro 12.3.0.557 Free
IObit Driver Booster Pro 12.3.0.557 Free
mohsinrazakpa95
Jotform AI Agents: Real User Success Stories
Jotform AI Agents: Real User Success StoriesJotform AI Agents: Real User Success Stories
Jotform AI Agents: Real User Success Stories
Jotform
A Brief Introduction About Jeff Menashe
A Brief Introduction About  Jeff MenasheA Brief Introduction About  Jeff Menashe
A Brief Introduction About Jeff Menashe
Jeff Menashe
Lecture2_REQUIREMENT_Process__Modelss.pptx
Lecture2_REQUIREMENT_Process__Modelss.pptxLecture2_REQUIREMENT_Process__Modelss.pptx
Lecture2_REQUIREMENT_Process__Modelss.pptx
Aqsa162589
Java and AI with LangChain4j: Jakarta EE and AI
Java and AI with LangChain4j: Jakarta EE and AIJava and AI with LangChain4j: Jakarta EE and AI
Java and AI with LangChain4j: Jakarta EE and AI
Edward Burns
Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025
bibi39322
Threat Modeling & Risk Assessment Webinar: A Step-by-Step Example
Threat Modeling & Risk Assessment Webinar: A Step-by-Step ExampleThreat Modeling & Risk Assessment Webinar: A Step-by-Step Example
Threat Modeling & Risk Assessment Webinar: A Step-by-Step Example
ICS
Wondershare Democreator 8.3.3 Crack Activated Free Download
Wondershare Democreator 8.3.3 Crack Activated Free DownloadWondershare Democreator 8.3.3 Crack Activated Free Download
Wondershare Democreator 8.3.3 Crack Activated Free Download
adanataj41
Wondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free DownloadWondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free Download
anglekaan18
Oracle Database administration Security PPT
Oracle Database administration Security PPTOracle Database administration Security PPT
Oracle Database administration Security PPT
pshankarnarayan
Parallels Desktop Crack [Latest] 2025 free
Parallels Desktop Crack [Latest] 2025 freeParallels Desktop Crack [Latest] 2025 free
Parallels Desktop Crack [Latest] 2025 free
mohsinrazakpa96
Wondershare Filmora 14.3.2.11147 crack
Wondershare Filmora   14.3.2.11147 crackWondershare Filmora   14.3.2.11147 crack
Wondershare Filmora 14.3.2.11147 crack
blouch51kp
Kaspersky Lab Products Remover 1.0.5497.0
Kaspersky Lab Products Remover 1.0.5497.0Kaspersky Lab Products Remover 1.0.5497.0
Kaspersky Lab Products Remover 1.0.5497.0
mohsinrazakpa93
Jotform AI Agents: Overview and Benefits
Jotform AI Agents: Overview and BenefitsJotform AI Agents: Overview and Benefits
Jotform AI Agents: Overview and Benefits
Jotform
Top Performance Testing Tools of 2025: Ensure Speed, Stability, and Scale
Top Performance Testing Tools of 2025: Ensure Speed, Stability, and ScaleTop Performance Testing Tools of 2025: Ensure Speed, Stability, and Scale
Top Performance Testing Tools of 2025: Ensure Speed, Stability, and Scale
Shubham Joshi
Java and AI with LangChain4j: Jakarta EE gets AI
Java and AI with LangChain4j: Jakarta EE gets AIJava and AI with LangChain4j: Jakarta EE gets AI
Java and AI with LangChain4j: Jakarta EE gets AI
Edward Burns
Building-Your-Professional-Website-No-Coding-Required
Building-Your-Professional-Website-No-Coding-RequiredBuilding-Your-Professional-Website-No-Coding-Required
Building-Your-Professional-Website-No-Coding-Required
Ozias Rondon
Image-Line FL Studio 20.8.3.2304 crack free
Image-Line FL Studio 20.8.3.2304 crack freeImage-Line FL Studio 20.8.3.2304 crack free
Image-Line FL Studio 20.8.3.2304 crack free
alihamzakpa084
Making significant software architecture decisions
Making significant software architecture decisionsMaking significant software architecture decisions
Making significant software architecture decisions
Bert Jan Schrijver
IObit Driver Booster Pro 12.3.0.557 Free
IObit Driver Booster Pro 12.3.0.557 FreeIObit Driver Booster Pro 12.3.0.557 Free
IObit Driver Booster Pro 12.3.0.557 Free
blouch51kp
IObit Driver Booster Pro 12.3.0.557 Free
IObit Driver Booster Pro 12.3.0.557 FreeIObit Driver Booster Pro 12.3.0.557 Free
IObit Driver Booster Pro 12.3.0.557 Free
mohsinrazakpa95

R Data Structures (Part 1)

  • 1. R Data Structures WMG Training Sept 2016 National Environmental Standards and Regulations Enforcement Agency (NESREA) Facilitator: Victor Ordu
  • 2. Source: H Wickham (2014). Advanced R. Chapman & Hall, Boca Raton. http://adv-r.had.co.nz/
  • 5. Caveat Not everything I will tell you will be 100% correct Why? Stupid mistakes Updates New knowledge Multiple approaches, some better than others Continuous learning Moral: commit to personal growth
  • 6. Notation Regular text with look like this Highlighted items will look like this this <- R_code(will look like)
  • 7. Types of Data Structures 1. Vectors 2. Data frames 3. Matrices 4. Lists 5. Arrays
  • 8. Types of Data Structures 1. Vectors 2. Data frames 3. Matrices 4. Lists 5. Arrays
  • 10. Kinds of Vectors Six (6) kinds: 1. Character 2. Integer 3. Double (or numeric) 4. Logical
  • 11. Vectors Common characteristics All elements are of a particular data type (in lay language, type would be numbers, words, etc.) One-dimensional The lowest vector is of length 1 The largest well, depends on the .Machine
  • 12. Making vectors By assignment The concatenate function Latin: con caten atus (chain) Some call it combine function Indispensible in creating vectors You can grow a vector You may ask how, much, much, much, much later
  • 13. Character vectors Strings are always placed in quotation marks when coding i.e. boy, NESREA, R is easy to learn, A string can be a whole sentence!, 9. Some character vectors are inbuilt into R e.g. letters, LETTERS, month.abb, month.name Remember use quotation marks: or . We can create empty vectors with specific lengths e.g. character(length = 10) or character(10) Limit approx. 231 (about 2 billion) characters!
  • 14. Exercise Start a clean slate with rm(list = ls()) Make a character vector Name containing full names (both Surname and Given Name) of 10 adults Make a second vector Facility of names of 10 facilities (imaginary, please!) Use typeof() to check what type of vector Name is Confirm the type of Facility using is.character() Note: We can use as.character() to convert another vector to a character vector.
  • 15. Integer vectors 1L, 2L, 3L Why the L? Not numerical per se Wide range max up to 2,147,483,647 Exercise Make an integer vector Age of 10 adult subjects Make an integer vector StaffStrength for 10 facilities
  • 16. Numeric (double) vectors These are real numbers Story of the term double Some numeric vectors are inbuilt mathematical constants e.g. pi, exp(1),
  • 17. Logical vectors TRUE/FALSE (not true/false); T/F Zero is FALSE; any non-zero is TRUE Exercise Make a logical vector PermitSighted for 10 facilities. Make another one usingPPE for 10 individuals. Use str(), typeof(), is.logical(), to explore them.
  • 18. Stats brief Types of variables Quantitative Qualitative Levels of measurement Nominal Ordinal Interval Ratio
  • 19. Factors Integer values that are mapped to strings Used to represent categorical data Each category is called a level One of the most powerful uses of R Exercise Make a vector industryType using 3 categories small, medium, large for 10 facilities only. Make a factor industryCategory by calling the function factor() on industryType. Now use typeof(), is.factor, is.character, is.integer() to review these 2 objects.
  • 20. Things to note Legal names Coercion Limits Common mistakes Confusing factors with characters
  • 21. Homogenous Heterogeneous 1-dimension Atomic vectors Lists 2-dimensions Matrices Data frames N-dimensions Arrays
  • 22. > R toolbox help() or ? getwd(); setwd() ls() rm() save(); load()
  • 23. > R toolbox An example ls() Its relatively easy to see all the objects at a glance Note that this function is called without any arguments
  • 24. > R toolbox But how do you deal with this? Long list beyond screen
  • 25. > R toolbox Extend use of functions by defining other parameters (optional) Use ? to learn about a functions uses & arguments When more familiar, use others like args()
  • 27. Types of Data Structures 1. Vectors 2. Data frames 3. Matrices 4. Lists 5. Arrays

Editor's Notes

  • #14: In the Bible (presumably KJV): 3,566,480 letters 31,102 verses 1,189 chapters