SlideShare a Scribd company logo
1 of 5
Summary
• Data Structures: vector, matrix, list, and data.frame
• Importing data into R/RStudio
• Selecting of rows and columns from a dataset
• Adding and removing columns and rows
• Categorizing continuous variables
• Replacing values within data frames
• #Replace "Male" with 1 in the Gender column
• data$Gender[data$Gender == "Male"] <- 1
Other functions
• cor(x, y)
• #Correlation between age and total spending
• cor(churn_data$Age, churn_data$Total_Spend)
Frequency Distribution
• table() - used to create frequency tables
• table(churn_data$Satisfaction_Score)
• table(churn_data$Satisfaction_Score, churn_data$Target_Churn)
• prop.table() - used to create frequency tables of proportions
• prop.table(table(churn_data$Satisfaction_Score))
• prop.table(table(churn_data$Satisfaction_Score,
churn_data$Target_Churn))
Basic Plots
Scatterplot
• plot()
• plot(churn_data$Age,
churn_data$Average_Transaction_Am
ount)
Frequency Histogram
• hist()
• hist(churn_data$Age)
• hist(churn_data$Age, main = "Histogram
of Online Customer Age", xlab = "AGE")
Other plot functions
Graph type Base R function
scatterplot plot()
frequency histogram hist()
boxplot boxplot()
Cleveland dotplot dotchart()
scatterplot matrix pairs()
conditioning plot coplot()

More Related Content

Similar to R analysis and data integration for dummies

Data wrangling with dplyr
Data wrangling with dplyrData wrangling with dplyr
Data wrangling with dplyrC. Tobin Magle
 
Data Analytics with R and SQL Server
Data Analytics with R and SQL ServerData Analytics with R and SQL Server
Data Analytics with R and SQL ServerStéphane Fréchette
 
PHStat Notes Using the PHStat Stack Data and .docx
    PHStat Notes    Using the  PHStat Stack Data  and .docx    PHStat Notes    Using the  PHStat Stack Data  and .docx
PHStat Notes Using the PHStat Stack Data and .docxShiraPrater50
 
Exploratory data analysis using r
Exploratory data analysis using rExploratory data analysis using r
Exploratory data analysis using rTahera Shaikh
 
Introduction - Using Stata
Introduction - Using StataIntroduction - Using Stata
Introduction - Using StataRyan Herzog
 
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners Jen Stirrup
 
Revisiting the fundamental concepts and assumptions of statistics pps
Revisiting the fundamental concepts and assumptions of statistics ppsRevisiting the fundamental concepts and assumptions of statistics pps
Revisiting the fundamental concepts and assumptions of statistics ppsD Dutta Roy
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessingTony Nguyen
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessingHarry Potter
 

Similar to R analysis and data integration for dummies (20)

Data wrangling with dplyr
Data wrangling with dplyrData wrangling with dplyr
Data wrangling with dplyr
 
Data Analytics with R and SQL Server
Data Analytics with R and SQL ServerData Analytics with R and SQL Server
Data Analytics with R and SQL Server
 
PHStat Notes Using the PHStat Stack Data and .docx
    PHStat Notes    Using the  PHStat Stack Data  and .docx    PHStat Notes    Using the  PHStat Stack Data  and .docx
PHStat Notes Using the PHStat Stack Data and .docx
 
ML MODULE 2.pdf
ML MODULE 2.pdfML MODULE 2.pdf
ML MODULE 2.pdf
 
Introduction
IntroductionIntroduction
Introduction
 
Data exploration in r
Data exploration in rData exploration in r
Data exploration in r
 
Data1
Data1Data1
Data1
 
Data1
Data1Data1
Data1
 
Language R
Language RLanguage R
Language R
 
Exploratory data analysis using r
Exploratory data analysis using rExploratory data analysis using r
Exploratory data analysis using r
 
Linear Regression.pptx
Linear Regression.pptxLinear Regression.pptx
Linear Regression.pptx
 
Introduction - Using Stata
Introduction - Using StataIntroduction - Using Stata
Introduction - Using Stata
 
Data Mining Lecture_9.pptx
Data Mining Lecture_9.pptxData Mining Lecture_9.pptx
Data Mining Lecture_9.pptx
 
R training3
R training3R training3
R training3
 
CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners CuRious about R in Power BI? End to end R in Power BI for beginners
CuRious about R in Power BI? End to end R in Power BI for beginners
 
EDA.pptx
EDA.pptxEDA.pptx
EDA.pptx
 
R for Statistical Computing
R for Statistical ComputingR for Statistical Computing
R for Statistical Computing
 
Revisiting the fundamental concepts and assumptions of statistics pps
Revisiting the fundamental concepts and assumptions of statistics ppsRevisiting the fundamental concepts and assumptions of statistics pps
Revisiting the fundamental concepts and assumptions of statistics pps
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 

More from DemelashAsege

Managing Relationship IN cOMPLEXT B2B mARKETING
Managing Relationship IN cOMPLEXT B2B mARKETINGManaging Relationship IN cOMPLEXT B2B mARKETING
Managing Relationship IN cOMPLEXT B2B mARKETINGDemelashAsege
 
Final Strategic alliances and research management
Final Strategic alliances and research managementFinal Strategic alliances and research management
Final Strategic alliances and research managementDemelashAsege
 
Premium and Pricing for Green Flights.ppt
Premium and Pricing for Green Flights.pptPremium and Pricing for Green Flights.ppt
Premium and Pricing for Green Flights.pptDemelashAsege
 
Chapter 2 OF PURCHASING MANAGEMENT OF SERVICES
Chapter 2 OF PURCHASING MANAGEMENT OF SERVICESChapter 2 OF PURCHASING MANAGEMENT OF SERVICES
Chapter 2 OF PURCHASING MANAGEMENT OF SERVICESDemelashAsege
 
new green transportation for emerging markets
new green transportation for emerging marketsnew green transportation for emerging markets
new green transportation for emerging marketsDemelashAsege
 
Strategizing Experiments and Beautifying the results
Strategizing Experiments and Beautifying the resultsStrategizing Experiments and Beautifying the results
Strategizing Experiments and Beautifying the resultsDemelashAsege
 
Chapter Five: Reserach Design
Chapter Five: Reserach DesignChapter Five: Reserach Design
Chapter Five: Reserach DesignDemelashAsege
 
Chapter 8: Measurement and Sampling
Chapter 8: Measurement and SamplingChapter 8: Measurement and Sampling
Chapter 8: Measurement and SamplingDemelashAsege
 

More from DemelashAsege (8)

Managing Relationship IN cOMPLEXT B2B mARKETING
Managing Relationship IN cOMPLEXT B2B mARKETINGManaging Relationship IN cOMPLEXT B2B mARKETING
Managing Relationship IN cOMPLEXT B2B mARKETING
 
Final Strategic alliances and research management
Final Strategic alliances and research managementFinal Strategic alliances and research management
Final Strategic alliances and research management
 
Premium and Pricing for Green Flights.ppt
Premium and Pricing for Green Flights.pptPremium and Pricing for Green Flights.ppt
Premium and Pricing for Green Flights.ppt
 
Chapter 2 OF PURCHASING MANAGEMENT OF SERVICES
Chapter 2 OF PURCHASING MANAGEMENT OF SERVICESChapter 2 OF PURCHASING MANAGEMENT OF SERVICES
Chapter 2 OF PURCHASING MANAGEMENT OF SERVICES
 
new green transportation for emerging markets
new green transportation for emerging marketsnew green transportation for emerging markets
new green transportation for emerging markets
 
Strategizing Experiments and Beautifying the results
Strategizing Experiments and Beautifying the resultsStrategizing Experiments and Beautifying the results
Strategizing Experiments and Beautifying the results
 
Chapter Five: Reserach Design
Chapter Five: Reserach DesignChapter Five: Reserach Design
Chapter Five: Reserach Design
 
Chapter 8: Measurement and Sampling
Chapter 8: Measurement and SamplingChapter 8: Measurement and Sampling
Chapter 8: Measurement and Sampling
 

Recently uploaded

1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证ppy8zfkfm
 
Aggregations - The Elasticsearch "GROUP BY"
Aggregations - The Elasticsearch "GROUP BY"Aggregations - The Elasticsearch "GROUP BY"
Aggregations - The Elasticsearch "GROUP BY"John Sobanski
 
如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证
如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证
如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证a8om7o51
 
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Valters Lauzums
 
Formulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfFormulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfRobertoOcampo24
 
Credit Card Fraud Detection: Safeguarding Transactions in the Digital Age
Credit Card Fraud Detection: Safeguarding Transactions in the Digital AgeCredit Card Fraud Detection: Safeguarding Transactions in the Digital Age
Credit Card Fraud Detection: Safeguarding Transactions in the Digital AgeBoston Institute of Analytics
 
社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token PredictionNABLAS株式会社
 
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...ThinkInnovation
 
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...Klinik Aborsi
 
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证pwgnohujw
 
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...ThinkInnovation
 
Bios of leading Astrologers & Researchers
Bios of leading Astrologers & ResearchersBios of leading Astrologers & Researchers
Bios of leading Astrologers & Researchersdarmandersingh4580
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证acoha1
 
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证dq9vz1isj
 
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...yulianti213969
 
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...ssuserf63bd7
 
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证ju0dztxtn
 
Digital Marketing Demystified: Expert Tips from Samantha Rae Coolbeth
Digital Marketing Demystified: Expert Tips from Samantha Rae CoolbethDigital Marketing Demystified: Expert Tips from Samantha Rae Coolbeth
Digital Marketing Demystified: Expert Tips from Samantha Rae CoolbethSamantha Rae Coolbeth
 
obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...
obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...
obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...yulianti213969
 
NOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam DunksNOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam Dunksgmuir1066
 

Recently uploaded (20)

1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
 
Aggregations - The Elasticsearch "GROUP BY"
Aggregations - The Elasticsearch "GROUP BY"Aggregations - The Elasticsearch "GROUP BY"
Aggregations - The Elasticsearch "GROUP BY"
 
如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证
如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证
如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证
 
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
 
Formulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfFormulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdf
 
Credit Card Fraud Detection: Safeguarding Transactions in the Digital Age
Credit Card Fraud Detection: Safeguarding Transactions in the Digital AgeCredit Card Fraud Detection: Safeguarding Transactions in the Digital Age
Credit Card Fraud Detection: Safeguarding Transactions in the Digital Age
 
社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction
 
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
 
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
 
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
 
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
 
Bios of leading Astrologers & Researchers
Bios of leading Astrologers & ResearchersBios of leading Astrologers & Researchers
Bios of leading Astrologers & Researchers
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
 
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
 
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
 
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
 
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
 
Digital Marketing Demystified: Expert Tips from Samantha Rae Coolbeth
Digital Marketing Demystified: Expert Tips from Samantha Rae CoolbethDigital Marketing Demystified: Expert Tips from Samantha Rae Coolbeth
Digital Marketing Demystified: Expert Tips from Samantha Rae Coolbeth
 
obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...
obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...
obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...
 
NOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam DunksNOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam Dunks
 

R analysis and data integration for dummies

  • 1. Summary • Data Structures: vector, matrix, list, and data.frame • Importing data into R/RStudio • Selecting of rows and columns from a dataset • Adding and removing columns and rows • Categorizing continuous variables • Replacing values within data frames • #Replace "Male" with 1 in the Gender column • data$Gender[data$Gender == "Male"] <- 1
  • 2. Other functions • cor(x, y) • #Correlation between age and total spending • cor(churn_data$Age, churn_data$Total_Spend)
  • 3. Frequency Distribution • table() - used to create frequency tables • table(churn_data$Satisfaction_Score) • table(churn_data$Satisfaction_Score, churn_data$Target_Churn) • prop.table() - used to create frequency tables of proportions • prop.table(table(churn_data$Satisfaction_Score)) • prop.table(table(churn_data$Satisfaction_Score, churn_data$Target_Churn))
  • 4. Basic Plots Scatterplot • plot() • plot(churn_data$Age, churn_data$Average_Transaction_Am ount) Frequency Histogram • hist() • hist(churn_data$Age) • hist(churn_data$Age, main = "Histogram of Online Customer Age", xlab = "AGE")
  • 5. Other plot functions Graph type Base R function scatterplot plot() frequency histogram hist() boxplot boxplot() Cleveland dotplot dotchart() scatterplot matrix pairs() conditioning plot coplot()

Editor's Notes

  1. Removing observations (na.omit() function).
  2. df$Gender[df$Gender == "Male"] <- 1
  3. A histogram is very common plot. It plots the frequencies that data appears within certain ranges. A scatter plot provides a graphical view of the relationship between two sets of numbers.
  4. Simple base R plots There are many functions in R to produce plots ranging from the very basic to the highly complex. It’s impossible to cover every aspect of producing graphics in R in this introductory book so we’ll introduce you to most of the common methods of graphing data and describe how to customise your graphs later on in this Chapter.