SlideShare a Scribd company logo
1 of 9
Prof. Neeraj Bhargava
Pramod Singh Rathore
Department of Computer Science
School of Engineering & System Sciences,
MDS University Ajmer, Rajasthan, India
1
Handle list, matrics,factors in R
Session Objectives
 How to handle List in R
2
Data types in R
3
Data types can be listed as
• Vectors
• Lists
• Matrices
• Data Frames
• Factors
How to handle list in R
4
a=c(2,3,4) output : 2 3 4
b=(“ab”,”bc”,”ef”)
d=c(True,False)
list(a,b,d)
lst_1=list(abd)
lst_1[[1]]
lst_1[[1]] [1]
Lst_1[[2]][3]=“xy” “ab” ”bc” ”xy”
How to handle matrices in R
5
matr=matrix(c(1,2,3,4,5,6),nrow=3,ncol=2,byrow=F) 1 4
matr 2 5
3 6
matr[,1]
matr[1,]
matr[1,1]
matr=cbind(matr,c(3,5,7)) ?cbind
matr=rbind(matr,c(3,5,7))
dimnames(matr)=list(c(”r1”,”r2”,”r3”,”r4”)c(“c1”,”c2”,”c3”,”c4”)
t(matr)
How to handle factors in R
6
y=factor(c(“first”,”second”,”first”,”first”,”third”)) 3level
z-=y[1:4]
Y[6]=“fourth”
levels(y)=c(level(y),”fourth”)
levels(y)
Assignment 1
 What is data types in R?
 Explain each data type with suitable example
7
Queries ????
8
9

More Related Content

Similar to Handle list in r

Similar to Handle list in r (20)

Data types in r
Data types in rData types in r
Data types in r
 
Chapter 3 Built-in Data Structures, Functions, and Files .pptx
Chapter 3 Built-in Data Structures, Functions, and Files .pptxChapter 3 Built-in Data Structures, Functions, and Files .pptx
Chapter 3 Built-in Data Structures, Functions, and Files .pptx
 
Python lecture 04
Python lecture 04Python lecture 04
Python lecture 04
 
Python-List.pptx
Python-List.pptxPython-List.pptx
Python-List.pptx
 
R language, an introduction
R language, an introductionR language, an introduction
R language, an introduction
 
R lecture oga
R lecture ogaR lecture oga
R lecture oga
 
Basic of array and data structure, data structure basics, array, address calc...
Basic of array and data structure, data structure basics, array, address calc...Basic of array and data structure, data structure basics, array, address calc...
Basic of array and data structure, data structure basics, array, address calc...
 
R
RR
R
 
Introduction2R
Introduction2RIntroduction2R
Introduction2R
 
R training3
R training3R training3
R training3
 
Module III.pdf
Module III.pdfModule III.pdf
Module III.pdf
 
Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)
 
Relations & functions
Relations & functionsRelations & functions
Relations & functions
 
IA-advanced-R
IA-advanced-RIA-advanced-R
IA-advanced-R
 
Day 1d R structures & objects: matrices and data frames.pptx
Day 1d   R structures & objects: matrices and data frames.pptxDay 1d   R structures & objects: matrices and data frames.pptx
Day 1d R structures & objects: matrices and data frames.pptx
 
Big datacourse
Big datacourseBig datacourse
Big datacourse
 
updated_list.pptx
updated_list.pptxupdated_list.pptx
updated_list.pptx
 
Introduction to R for Data Science :: Session 3
Introduction to R for Data Science :: Session 3Introduction to R for Data Science :: Session 3
Introduction to R for Data Science :: Session 3
 
Slides ads ia
Slides ads iaSlides ads ia
Slides ads ia
 
Language R
Language RLanguage R
Language R
 

More from Pramod Rathore

Restoration by spatial filtering
Restoration by spatial filteringRestoration by spatial filtering
Restoration by spatial filteringPramod Rathore
 
Image enhancement in frequency domain
Image enhancement in frequency domainImage enhancement in frequency domain
Image enhancement in frequency domainPramod Rathore
 
Image enhancement in fourier transform part ii
Image enhancement in fourier transform  part iiImage enhancement in fourier transform  part ii
Image enhancement in fourier transform part iiPramod Rathore
 
Image enhancement in fourier transform
Image enhancement in fourier transformImage enhancement in fourier transform
Image enhancement in fourier transformPramod Rathore
 
Smoothing spatial filtering
Smoothing spatial filteringSmoothing spatial filtering
Smoothing spatial filteringPramod Rathore
 
6.histogram processing
6.histogram processing6.histogram processing
6.histogram processingPramod Rathore
 
5.image enhancement in spatial domain copy - copy
5.image enhancement in spatial domain   copy - copy5.image enhancement in spatial domain   copy - copy
5.image enhancement in spatial domain copy - copyPramod Rathore
 
4.image enhancement in spatial domain copy
4.image enhancement in spatial domain   copy4.image enhancement in spatial domain   copy
4.image enhancement in spatial domain copyPramod Rathore
 
Issues in machine learning
Issues in machine learningIssues in machine learning
Issues in machine learningPramod Rathore
 
Image enhancement in spatial domain
Image enhancement in spatial domainImage enhancement in spatial domain
Image enhancement in spatial domainPramod Rathore
 
1.introduction to data science
1.introduction to data science1.introduction to data science
1.introduction to data sciencePramod Rathore
 

More from Pramod Rathore (20)

Restoration by spatial filtering
Restoration by spatial filteringRestoration by spatial filtering
Restoration by spatial filtering
 
Image restoration
Image restorationImage restoration
Image restoration
 
Homomorphic filtering
Homomorphic filteringHomomorphic filtering
Homomorphic filtering
 
Sharpening filtering
Sharpening filteringSharpening filtering
Sharpening filtering
 
Image enhancement in frequency domain
Image enhancement in frequency domainImage enhancement in frequency domain
Image enhancement in frequency domain
 
Image enhancement in fourier transform part ii
Image enhancement in fourier transform  part iiImage enhancement in fourier transform  part ii
Image enhancement in fourier transform part ii
 
Image enhancement in fourier transform
Image enhancement in fourier transformImage enhancement in fourier transform
Image enhancement in fourier transform
 
Control statements
Control statementsControl statements
Control statements
 
Basic image operation
Basic image operationBasic image operation
Basic image operation
 
Smoothing spatial filtering
Smoothing spatial filteringSmoothing spatial filtering
Smoothing spatial filtering
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
6.histogram processing
6.histogram processing6.histogram processing
6.histogram processing
 
5.image enhancement in spatial domain copy - copy
5.image enhancement in spatial domain   copy - copy5.image enhancement in spatial domain   copy - copy
5.image enhancement in spatial domain copy - copy
 
4.image enhancement in spatial domain copy
4.image enhancement in spatial domain   copy4.image enhancement in spatial domain   copy
4.image enhancement in spatial domain copy
 
Issues in machine learning
Issues in machine learningIssues in machine learning
Issues in machine learning
 
R programming
R programmingR programming
R programming
 
Image enhancement in spatial domain
Image enhancement in spatial domainImage enhancement in spatial domain
Image enhancement in spatial domain
 
2.image enhancement
2.image enhancement2.image enhancement
2.image enhancement
 
Id3
Id3Id3
Id3
 
1.introduction to data science
1.introduction to data science1.introduction to data science
1.introduction to data science
 

Recently uploaded

General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Recently uploaded (20)

General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

Handle list in r

  • 1. Prof. Neeraj Bhargava Pramod Singh Rathore Department of Computer Science School of Engineering & System Sciences, MDS University Ajmer, Rajasthan, India 1 Handle list, matrics,factors in R
  • 2. Session Objectives  How to handle List in R 2
  • 3. Data types in R 3 Data types can be listed as • Vectors • Lists • Matrices • Data Frames • Factors
  • 4. How to handle list in R 4 a=c(2,3,4) output : 2 3 4 b=(“ab”,”bc”,”ef”) d=c(True,False) list(a,b,d) lst_1=list(abd) lst_1[[1]] lst_1[[1]] [1] Lst_1[[2]][3]=“xy” “ab” ”bc” ”xy”
  • 5. How to handle matrices in R 5 matr=matrix(c(1,2,3,4,5,6),nrow=3,ncol=2,byrow=F) 1 4 matr 2 5 3 6 matr[,1] matr[1,] matr[1,1] matr=cbind(matr,c(3,5,7)) ?cbind matr=rbind(matr,c(3,5,7)) dimnames(matr)=list(c(”r1”,”r2”,”r3”,”r4”)c(“c1”,”c2”,”c3”,”c4”) t(matr)
  • 6. How to handle factors in R 6 y=factor(c(“first”,”second”,”first”,”first”,”third”)) 3level z-=y[1:4] Y[6]=“fourth” levels(y)=c(level(y),”fourth”) levels(y)
  • 7. Assignment 1  What is data types in R?  Explain each data type with suitable example 7
  • 9. 9