SlideShare uma empresa Scribd logo
1 de 13
Graphs in R
Codes are in Blue.
For Feedback Mail me: sharmakarishma91@gmail.com
Different types of graphs
• Line Chart
• Bar Chart
• Pie Chart
• Histogram
• Extras: Graphs for
– Regression
– Association
– Neural Networks
– Factor Analysis
For Feedback Mail me: sharmakarishma91@gmail.com
Line Chart
• l<-c(3,5,8,12,15,32,56) #data
• plot(l)
• plot(l,type=“l",col="blue")
• plot(l,type="o",col="blue")
title(main="line",col.main="red",font.main="12")
• plot(l,type="o",col="blue",main="line
chart",col.main="red",font.main=180,sub="line",col.sub="pin
k",font.sub=100,xlab="range",ylab="l",xlim=c(0,15),ylim=c(0,6
0))
For Feedback Mail me: sharmakarishma91@gmail.com
Contd..
• title(main="line
chart",col.main="red",font.main=180,sub="line",col.sub="pin
k",font.sub=100,xlab="range",ylab="l",xlim=c(0,15),ylim=c(0,6
0))
• text(l,pos=4,cex=3)
• b<-c(2,4,6,13,18,35,38,60) #data
• plot(l,type="o",pch=10,col="dark green")
• lines(b,type="o",pch=22,col="maroon")
For Feedback Mail me: sharmakarishma91@gmail.com
Bar Chart
• barplot(l,main="barplot",col.main="blue",font.main=60,densi
ty=c(10,20,30,40,50,60,70),xlab="range",ylab="b")
• barplot(l,main="barplot",col.main="blue",font.main=60,col=r
ainbow(7),xlab="range",ylab="b")
• z<-c(l,b) #using the previous data l and b
• barplot(as.matrix(z),col=rainbow(7),beside=T,cex.axis=1)
• box()
• legend(0,50,c(3,5,8,12,15,32,56),cex=1,bty="n",fill=rainbow(7
))
• barplot(l,main="barplot",col.main="blue",font.main=60,col=r
ainbow(7),xlab="range",ylab="b",space=5)
For Feedback Mail me: sharmakarishma91@gmail.com
Histogram
• hist(l,col=rainbow(4),xlab="range",ylab=“frequency",main="hi
stogram",col.main="forest green",font.main=100)
For Feedback Mail me: sharmakarishma91@gmail.com
Pie chart
• pie(b,main="piechart",col.main=rainbow(1),col=rainbow(7),la
bels=c("2","4","6","13","18","35","38","60"))
For Feedback Mail me: sharmakarishma91@gmail.com
Regression
• x <- rnorm(100)
• y <- rnorm(100)
• z <- 0.2*x - 0.3*y + rnorm(100, sd=0.3)
• fit <- lm(z ~ x + y)
• plot(fit)
• install.packages(“rgl”) # from cran library
• library(rgl)
• plot3d(x,y,z, type="s", col="red", size=1)
• coefs <- coef(fit)
For Feedback Mail me: sharmakarishma91@gmail.com
Contd..
• a <- coefs["x"]
• b <- coefs["y"]
• c <- -1
• d <- coefs["(Intercept)"]
• planes3d(a, b, c, d, alpha=0.5)
For Feedback Mail me: sharmakarishma91@gmail.com
Neural Network
• nn <-
neuralnet(case~age+parity+induced+spontaneous,data=infert
, hidden=3)
• plot(nn)
• plot(nn,rep="best",col.entry.synapse = "red",col.entry =
"green",col.hidden = "blue",col.hidden.synapse =
"brown",col.out = "orange",col.out.synapse =
"magenta",col.intercept = " dark green")
For Feedback Mail me: sharmakarishma91@gmail.com
Association
• Install packages
– arules
– arulesViz
• data(Groceries) # in-built dataset in R
• rules <- apriori(Groceries, parameter=list(support=0.001,
confidence=0.5))
• plot(rules)
• plot(rules, method="matrix", measure="lift")
• plot(rules, method="matrix3d", measure="lift")
• plot(rules, method="matrix", measure=c("lift", "confidence"))
• plot(rules, method="grouped")
For Feedback Mail me: sharmakarishma91@gmail.com
Factor Analysis
• Install packages
– psych
– GPArotation
• fan=read.csv(“fa.csv”,sep=“,”,h=T)
• fanl=fa(fan)
• fa.plot(fanl)
For Feedback Mail me: sharmakarishma91@gmail.com
THANK YOU.
Reference: http://cran.r-project.org/
For Feedback Mail me: sharmakarishma91@gmail.com

Mais conteúdo relacionado

Destaque

Artesaneando, Design Portfolio
Artesaneando, Design PortfolioArtesaneando, Design Portfolio
Artesaneando, Design PortfolioCitlalli Dunne
 
Arellano cilia taller 2
Arellano cilia taller 2Arellano cilia taller 2
Arellano cilia taller 2Cilia Arellano
 
Dealer_Application_2011.pdf
Dealer_Application_2011.pdfDealer_Application_2011.pdf
Dealer_Application_2011.pdfTim Cross
 
Ceci`S Hawaian Dream
Ceci`S Hawaian DreamCeci`S Hawaian Dream
Ceci`S Hawaian DreamMaria Filippa
 
The IMPACT of microlearning
The IMPACT of microlearningThe IMPACT of microlearning
The IMPACT of microlearningcfaisonjr
 
Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)Ralf Dannert
 
The case for real time collaboration
The case for real time collaborationThe case for real time collaboration
The case for real time collaborationSei Mani
 
Social Media Strategy for Tata Docomo
Social Media Strategy for Tata DocomoSocial Media Strategy for Tata Docomo
Social Media Strategy for Tata DocomoAakriti Agarwal
 

Destaque (14)

Programa interpr et
Programa interpr etPrograma interpr et
Programa interpr et
 
Artesaneando, Design Portfolio
Artesaneando, Design PortfolioArtesaneando, Design Portfolio
Artesaneando, Design Portfolio
 
Arellano cilia taller 2
Arellano cilia taller 2Arellano cilia taller 2
Arellano cilia taller 2
 
Dealer_Application_2011.pdf
Dealer_Application_2011.pdfDealer_Application_2011.pdf
Dealer_Application_2011.pdf
 
Ceci`S Hawaian Dream
Ceci`S Hawaian DreamCeci`S Hawaian Dream
Ceci`S Hawaian Dream
 
Proxy arp
Proxy arpProxy arp
Proxy arp
 
Hypothesis testing in R
Hypothesis testing in RHypothesis testing in R
Hypothesis testing in R
 
Leben im Netz
Leben im NetzLeben im Netz
Leben im Netz
 
The IMPACT of microlearning
The IMPACT of microlearningThe IMPACT of microlearning
The IMPACT of microlearning
 
Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)
 
The case for real time collaboration
The case for real time collaborationThe case for real time collaboration
The case for real time collaboration
 
Ftp connector
Ftp connectorFtp connector
Ftp connector
 
Social Media Strategy for Tata Docomo
Social Media Strategy for Tata DocomoSocial Media Strategy for Tata Docomo
Social Media Strategy for Tata Docomo
 
Galera replication
Galera replicationGalera replication
Galera replication
 

Semelhante a Graphs in R - Line, Bar, Pie, Histogram, Regression, Neural Networks

Exploratory data analysis using r
Exploratory data analysis using rExploratory data analysis using r
Exploratory data analysis using rTahera Shaikh
 
DrawingML Subject: Shape Properties & Effects
DrawingML Subject: Shape Properties & EffectsDrawingML Subject: Shape Properties & Effects
DrawingML Subject: Shape Properties & EffectsShawn Villaron
 
Data analysis with R
Data analysis with RData analysis with R
Data analysis with RShareThis
 
Chart and graphs in R programming language
Chart and graphs in R programming language Chart and graphs in R programming language
Chart and graphs in R programming language CHANDAN KUMAR
 
Exploratory Data Analysis
Exploratory Data AnalysisExploratory Data Analysis
Exploratory Data AnalysisUmair Shafique
 
Lectures r-graphics
Lectures r-graphicsLectures r-graphics
Lectures r-graphicsetyca
 

Semelhante a Graphs in R - Line, Bar, Pie, Histogram, Regression, Neural Networks (9)

R training5
R training5R training5
R training5
 
Exploratory data analysis using r
Exploratory data analysis using rExploratory data analysis using r
Exploratory data analysis using r
 
DrawingML Subject: Shape Properties & Effects
DrawingML Subject: Shape Properties & EffectsDrawingML Subject: Shape Properties & Effects
DrawingML Subject: Shape Properties & Effects
 
Data analysis with R
Data analysis with RData analysis with R
Data analysis with R
 
Chart and graphs in R programming language
Chart and graphs in R programming language Chart and graphs in R programming language
Chart and graphs in R programming language
 
Exploratory Data Analysis
Exploratory Data AnalysisExploratory Data Analysis
Exploratory Data Analysis
 
Lectures r-graphics
Lectures r-graphicsLectures r-graphics
Lectures r-graphics
 
Bill howe 8_graphs
Bill howe 8_graphsBill howe 8_graphs
Bill howe 8_graphs
 
FINAL_TAKE_HOME
FINAL_TAKE_HOMEFINAL_TAKE_HOME
FINAL_TAKE_HOME
 

Último

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Último (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Graphs in R - Line, Bar, Pie, Histogram, Regression, Neural Networks