SlideShare a Scribd company logo
REPORT AUTOMATION
USING R-STUDIO TO AUTOMATE POWERPOINT REPORTS
R-Studio installation – free
PowerPoint template - free
R-scripting skills
Marksmann Analytics2018-11-08
What do you need
officer – for manipulating ms-office
reshape2 – manipulating dataframes
rvg – adding vectors
mschart – adding ms-office charts
Marksmann Analytics2018-11-08
R-libraries
Call r libraries
library(officer)
library(reshape2)
library(rvg)
library(mschart)
Marksmann Analytics2018-11-08
1st step
Read and manipulate data
url<-https://www.centralbank.go.ke/national-payments-system/mobile-payments/
MobileMoney= read_html(url) %>%
html_nodes("table") %>%
html_table(fill = TRUE) %>%
.[[1]]
colnames(MobileMoney)<-MobileMoney[1,]
MobileMoney<-MobileMoney[2:nrow(MobileMoney),]
columns <-c("Agents", "Accounts (millions)", "Transactions (millions)","Value (KSh billions)")
MobileMoney[,columns]<-lapply(columns, function(x) as.numeric(MobileMoney[[x]]))
Marksmann Analytics2018-11-08
2nd step
Create charts
my_barchart <-ms_barchart(data = summ,
x = "Year", y = "Trans(M)",group=NULL)
my_barchart <- chart_settings( x = my_barchart,
dir="vertical", grouping="clustered", gap_width = 50 )
Marksmann Analytics2018-11-08
3rd step
Create powerpoint
my_pres <- read_pptx("Presentation4.pptx")%>%
add_slide(layout = "report", master = "Office Theme")%>%
ph_with_text(type = "body", str = paste(round(sum(MobileMoney$`Transactions (millions)`),2),"M"), index = 1) %>%
ph_with_img(type = "body", index = 2, src ="logo.png", height = 1.2, width = 1.2) %>%
ph_with_text(type = "body", str = paste(round(MobileMoney[1,2]/1000,2),"K"), index = 3) %>%
ph_with_text(type = "body", str = paste(round(sum(MobileMoney$`Accounts (millions)`),2),"M"), index = 4) %>%
ph_with_text(type = "body", str = paste(round(sum(MobileMoney$`Value (KSh billions)`),2),"M"), index = 5) %>%
ph_with_text(type = "body", str = "Growth in mobile payments reached 8% last year, and totalled KSh3.6trn ($36bn) in value, according to newly released Central
Bank of Kenya (CBK) data.While steady, the pace of expansion was slower than in 2016 and 2015, when growth rates of 19% and 17% were recorded,
respectively.", index = 6) %>%
ph_hyperlink(type = "body",id_chr = "6",href = "https://oxfordbusinessgroup.com/news/kenyan-mobile-money-grows-amid-decline-traditional-card-payments")
%>%
ph_with_chart(chart = my_barchart, type = "body",index=7) %>%
ph_with_text(type = "ftr", str = "Slide footer") %>%
ph_with_text(type = "dt", str = format(Sys.Date())) %>%
print(my_pres,target= "report.pptx")
Marksmann Analytics2018-11-08
4th step
8,490.92 M203.36 K 2,826.9 M 21,115.02 M
Growth in mobile payments
reached 8% last year, and totaled
KSh3.6trn ($36bn) in value,
according to newly released
Central Bank of Kenya (CBK) data.
While steady, the pace of
expansion was slower than in 2016
and 2015, when growth rates of
19% and 17% were recorded,
respectively.
Year Agents Accs(M) Trans(M) Value(M)
2007 8260 5.05 5.47 16.32
2008 42248 39.11 62.74 166.57
2009 198840 87.17 193.50 473.41
2010 387244 152.27 311.05 732.22
2011 505381 218.55 433.00 1169.15
2012 756828 235.89 577.37 1544.81
2013 1229654 282.55 732.60 1901.56
2014 1445664 311.02 911.34 2371.79
2015 1607424 321.00 1114.18 2816.10
2016 1943637 385.21 1331.01 3355.11
2017 1989624 418.45 1543.17 3638.47
2018 1783829 370.64 1275.49 2929.51
Marksmann Analytics2018-11-08
Agents Accounts Transactions Value
Mobile money analysis
Growth in mobile payments reached
8% last year, and totaled KSh3.6trn
($36bn) in value, according to newly
released Central Bank of Kenya (CBK)
data. While steady, the pace of
expansion was slower than in 2016
and 2015, when growth rates of 19%
and 17% were recorded, respectively.
0
200
400
600
800
1000
1200
1400
1600
1800
2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018
TRANS(M)
YEAR
Trans(M)
Trans(M)
Marksmann Analytics2018-11-08
8,490.92 M203.36 K 2,826.9 M 21,115.02 M
Agents Accounts Transactions Value
Mobile money analysis
Growth in mobile payments reached
8% last year, and totaled KSh3.6trn
($36bn) in value, according to
newly released Central Bank of
Kenya (CBK) data. While steady, the
pace of expansion was slower than
in 2016 and 2015, when growth
rates of 19% and 17% were
recorded, respectively.
0
200
400
600
800
1000
1200
1400
1600
1800
2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018
Trans(M)
Year
Trans(M)
Trans(M)
Marksmann Analytics2018-11-08
8,490.92 M203.36 K 2,826.9 M 21,115.02 M
Agents Accounts Transactions Value
Mobile money analysis
Email: info@justit.co.ke
Website: www.analysis.justit.co.ke
Marksmann Analytics2018-11-08
Get in touch

More Related Content

Similar to Powerpoint automation in R-Studio

[VFS 2019] Capitalize E-Commerce Opportunities
[VFS 2019] Capitalize E-Commerce Opportunities[VFS 2019] Capitalize E-Commerce Opportunities
[VFS 2019] Capitalize E-Commerce Opportunities
Nexus FrontierTech
 
ComCap Digital Retail Report April 2018
ComCap Digital Retail Report April 2018ComCap Digital Retail Report April 2018
ComCap Digital Retail Report April 2018
Charlotte Brook
 
naver-035420-Algorithm Investment Report
naver-035420-Algorithm Investment Reportnaver-035420-Algorithm Investment Report
naver-035420-Algorithm Investment Report
알고리즘 기업분석 컨설팅-알기컨,algikeon
 
Tracxn - Robotic Process Automation Startup Landscape
Tracxn - Robotic Process Automation Startup LandscapeTracxn - Robotic Process Automation Startup Landscape
Tracxn - Robotic Process Automation Startup Landscape
Tracxn
 
Impacts of data-driven AI in business sectors, Richard Stevens, ICT 2018, 05/...
Impacts of data-driven AI in business sectors, Richard Stevens, ICT 2018, 05/...Impacts of data-driven AI in business sectors, Richard Stevens, ICT 2018, 05/...
Impacts of data-driven AI in business sectors, Richard Stevens, ICT 2018, 05/...
DataBench
 
Tracxn Research — B2B E-Commerce Landscape, November 2016
Tracxn Research — B2B E-Commerce Landscape, November 2016Tracxn Research — B2B E-Commerce Landscape, November 2016
Tracxn Research — B2B E-Commerce Landscape, November 2016
Tracxn
 
Buy this burgeoning IT scrip for target of 290, 6 new product orders won in Q...
Buy this burgeoning IT scrip for target of 290, 6 new product orders won in Q...Buy this burgeoning IT scrip for target of 290, 6 new product orders won in Q...
Buy this burgeoning IT scrip for target of 290, 6 new product orders won in Q...
IndiaNotes.com
 
Economic Capsule - April 2017
Economic Capsule - April 2017Economic Capsule - April 2017
Economic Capsule - April 2017
Commercial Bank of Ceylon PLC
 
How Does Robotic Process Automation Work: All You Need to Know
How Does Robotic Process Automation Work: All You Need to KnowHow Does Robotic Process Automation Work: All You Need to Know
How Does Robotic Process Automation Work: All You Need to Know
NuMantra Technologies Inc.
 
2012_GTM Recommendation
2012_GTM Recommendation2012_GTM Recommendation
2012_GTM Recommendation
Rick VARGAS
 
Results Presentation 2Q16
Results Presentation 2Q16Results Presentation 2Q16
Results Presentation 2Q16
TIM RI
 
transaction_jun.pptx
transaction_jun.pptxtransaction_jun.pptx
transaction_jun.pptx
NitsuNegash
 
Tracxn - Robotic Process Automation Startup Landscape
Tracxn - Robotic Process Automation Startup LandscapeTracxn - Robotic Process Automation Startup Landscape
Tracxn - Robotic Process Automation Startup Landscape
Tracxn
 
Numerify IT Financial Analytics for ServiceNow
Numerify IT Financial Analytics for ServiceNowNumerify IT Financial Analytics for ServiceNow
Numerify IT Financial Analytics for ServiceNow
Numerify
 
City of Cape Town Automated Metering Infrastructure (AMI)
City of Cape Town Automated Metering Infrastructure (AMI) City of Cape Town Automated Metering Infrastructure (AMI)
City of Cape Town Automated Metering Infrastructure (AMI)
Rudy Abrahams
 
Tracxn - Sales Force Automation Startup Landscape
Tracxn - Sales Force Automation Startup LandscapeTracxn - Sales Force Automation Startup Landscape
Tracxn - Sales Force Automation Startup Landscape
Amar Christy
 
Tracxn - Sales Force Automation Startup Landscape
Tracxn - Sales Force Automation Startup LandscapeTracxn - Sales Force Automation Startup Landscape
Tracxn - Sales Force Automation Startup Landscape
Tracxn
 
Mobile Money Transfer & Remittances:
Mobile Money Transfer & Remittances:Mobile Money Transfer & Remittances:
Mobile Money Transfer & Remittances:
ReportLinker.com
 
Manufacturing ERP Software
Manufacturing ERP SoftwareManufacturing ERP Software
Manufacturing ERP Software
eresource erp
 
My Researches in VEOLIA
My Researches in VEOLIAMy Researches in VEOLIA
My Researches in VEOLIA
amanideutsch
 

Similar to Powerpoint automation in R-Studio (20)

[VFS 2019] Capitalize E-Commerce Opportunities
[VFS 2019] Capitalize E-Commerce Opportunities[VFS 2019] Capitalize E-Commerce Opportunities
[VFS 2019] Capitalize E-Commerce Opportunities
 
ComCap Digital Retail Report April 2018
ComCap Digital Retail Report April 2018ComCap Digital Retail Report April 2018
ComCap Digital Retail Report April 2018
 
naver-035420-Algorithm Investment Report
naver-035420-Algorithm Investment Reportnaver-035420-Algorithm Investment Report
naver-035420-Algorithm Investment Report
 
Tracxn - Robotic Process Automation Startup Landscape
Tracxn - Robotic Process Automation Startup LandscapeTracxn - Robotic Process Automation Startup Landscape
Tracxn - Robotic Process Automation Startup Landscape
 
Impacts of data-driven AI in business sectors, Richard Stevens, ICT 2018, 05/...
Impacts of data-driven AI in business sectors, Richard Stevens, ICT 2018, 05/...Impacts of data-driven AI in business sectors, Richard Stevens, ICT 2018, 05/...
Impacts of data-driven AI in business sectors, Richard Stevens, ICT 2018, 05/...
 
Tracxn Research — B2B E-Commerce Landscape, November 2016
Tracxn Research — B2B E-Commerce Landscape, November 2016Tracxn Research — B2B E-Commerce Landscape, November 2016
Tracxn Research — B2B E-Commerce Landscape, November 2016
 
Buy this burgeoning IT scrip for target of 290, 6 new product orders won in Q...
Buy this burgeoning IT scrip for target of 290, 6 new product orders won in Q...Buy this burgeoning IT scrip for target of 290, 6 new product orders won in Q...
Buy this burgeoning IT scrip for target of 290, 6 new product orders won in Q...
 
Economic Capsule - April 2017
Economic Capsule - April 2017Economic Capsule - April 2017
Economic Capsule - April 2017
 
How Does Robotic Process Automation Work: All You Need to Know
How Does Robotic Process Automation Work: All You Need to KnowHow Does Robotic Process Automation Work: All You Need to Know
How Does Robotic Process Automation Work: All You Need to Know
 
2012_GTM Recommendation
2012_GTM Recommendation2012_GTM Recommendation
2012_GTM Recommendation
 
Results Presentation 2Q16
Results Presentation 2Q16Results Presentation 2Q16
Results Presentation 2Q16
 
transaction_jun.pptx
transaction_jun.pptxtransaction_jun.pptx
transaction_jun.pptx
 
Tracxn - Robotic Process Automation Startup Landscape
Tracxn - Robotic Process Automation Startup LandscapeTracxn - Robotic Process Automation Startup Landscape
Tracxn - Robotic Process Automation Startup Landscape
 
Numerify IT Financial Analytics for ServiceNow
Numerify IT Financial Analytics for ServiceNowNumerify IT Financial Analytics for ServiceNow
Numerify IT Financial Analytics for ServiceNow
 
City of Cape Town Automated Metering Infrastructure (AMI)
City of Cape Town Automated Metering Infrastructure (AMI) City of Cape Town Automated Metering Infrastructure (AMI)
City of Cape Town Automated Metering Infrastructure (AMI)
 
Tracxn - Sales Force Automation Startup Landscape
Tracxn - Sales Force Automation Startup LandscapeTracxn - Sales Force Automation Startup Landscape
Tracxn - Sales Force Automation Startup Landscape
 
Tracxn - Sales Force Automation Startup Landscape
Tracxn - Sales Force Automation Startup LandscapeTracxn - Sales Force Automation Startup Landscape
Tracxn - Sales Force Automation Startup Landscape
 
Mobile Money Transfer & Remittances:
Mobile Money Transfer & Remittances:Mobile Money Transfer & Remittances:
Mobile Money Transfer & Remittances:
 
Manufacturing ERP Software
Manufacturing ERP SoftwareManufacturing ERP Software
Manufacturing ERP Software
 
My Researches in VEOLIA
My Researches in VEOLIAMy Researches in VEOLIA
My Researches in VEOLIA
 

Recently uploaded

06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
v7oacc3l
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
jitskeb
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
jerlynmaetalle
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Aggregage
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
Walaa Eldin Moustafa
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
vikram sood
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
74nqk8xf
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
Social Samosa
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
manishkhaire30
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
soxrziqu
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
Lars Albertsson
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
Sm321
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
apvysm8
 
State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023
kuntobimo2016
 
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdfUdemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Fernanda Palhano
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
Social Samosa
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
roli9797
 
DSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelinesDSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelines
Timothy Spann
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
rwarrenll
 

Recently uploaded (20)

06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
 
State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023
 
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdfUdemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
 
DSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelinesDSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelines
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
 

Powerpoint automation in R-Studio

  • 1. REPORT AUTOMATION USING R-STUDIO TO AUTOMATE POWERPOINT REPORTS
  • 2. R-Studio installation – free PowerPoint template - free R-scripting skills Marksmann Analytics2018-11-08 What do you need
  • 3. officer – for manipulating ms-office reshape2 – manipulating dataframes rvg – adding vectors mschart – adding ms-office charts Marksmann Analytics2018-11-08 R-libraries
  • 5. Read and manipulate data url<-https://www.centralbank.go.ke/national-payments-system/mobile-payments/ MobileMoney= read_html(url) %>% html_nodes("table") %>% html_table(fill = TRUE) %>% .[[1]] colnames(MobileMoney)<-MobileMoney[1,] MobileMoney<-MobileMoney[2:nrow(MobileMoney),] columns <-c("Agents", "Accounts (millions)", "Transactions (millions)","Value (KSh billions)") MobileMoney[,columns]<-lapply(columns, function(x) as.numeric(MobileMoney[[x]])) Marksmann Analytics2018-11-08 2nd step
  • 6. Create charts my_barchart <-ms_barchart(data = summ, x = "Year", y = "Trans(M)",group=NULL) my_barchart <- chart_settings( x = my_barchart, dir="vertical", grouping="clustered", gap_width = 50 ) Marksmann Analytics2018-11-08 3rd step
  • 7. Create powerpoint my_pres <- read_pptx("Presentation4.pptx")%>% add_slide(layout = "report", master = "Office Theme")%>% ph_with_text(type = "body", str = paste(round(sum(MobileMoney$`Transactions (millions)`),2),"M"), index = 1) %>% ph_with_img(type = "body", index = 2, src ="logo.png", height = 1.2, width = 1.2) %>% ph_with_text(type = "body", str = paste(round(MobileMoney[1,2]/1000,2),"K"), index = 3) %>% ph_with_text(type = "body", str = paste(round(sum(MobileMoney$`Accounts (millions)`),2),"M"), index = 4) %>% ph_with_text(type = "body", str = paste(round(sum(MobileMoney$`Value (KSh billions)`),2),"M"), index = 5) %>% ph_with_text(type = "body", str = "Growth in mobile payments reached 8% last year, and totalled KSh3.6trn ($36bn) in value, according to newly released Central Bank of Kenya (CBK) data.While steady, the pace of expansion was slower than in 2016 and 2015, when growth rates of 19% and 17% were recorded, respectively.", index = 6) %>% ph_hyperlink(type = "body",id_chr = "6",href = "https://oxfordbusinessgroup.com/news/kenyan-mobile-money-grows-amid-decline-traditional-card-payments") %>% ph_with_chart(chart = my_barchart, type = "body",index=7) %>% ph_with_text(type = "ftr", str = "Slide footer") %>% ph_with_text(type = "dt", str = format(Sys.Date())) %>% print(my_pres,target= "report.pptx") Marksmann Analytics2018-11-08 4th step
  • 8. 8,490.92 M203.36 K 2,826.9 M 21,115.02 M Growth in mobile payments reached 8% last year, and totaled KSh3.6trn ($36bn) in value, according to newly released Central Bank of Kenya (CBK) data. While steady, the pace of expansion was slower than in 2016 and 2015, when growth rates of 19% and 17% were recorded, respectively. Year Agents Accs(M) Trans(M) Value(M) 2007 8260 5.05 5.47 16.32 2008 42248 39.11 62.74 166.57 2009 198840 87.17 193.50 473.41 2010 387244 152.27 311.05 732.22 2011 505381 218.55 433.00 1169.15 2012 756828 235.89 577.37 1544.81 2013 1229654 282.55 732.60 1901.56 2014 1445664 311.02 911.34 2371.79 2015 1607424 321.00 1114.18 2816.10 2016 1943637 385.21 1331.01 3355.11 2017 1989624 418.45 1543.17 3638.47 2018 1783829 370.64 1275.49 2929.51 Marksmann Analytics2018-11-08 Agents Accounts Transactions Value Mobile money analysis
  • 9. Growth in mobile payments reached 8% last year, and totaled KSh3.6trn ($36bn) in value, according to newly released Central Bank of Kenya (CBK) data. While steady, the pace of expansion was slower than in 2016 and 2015, when growth rates of 19% and 17% were recorded, respectively. 0 200 400 600 800 1000 1200 1400 1600 1800 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 TRANS(M) YEAR Trans(M) Trans(M) Marksmann Analytics2018-11-08 8,490.92 M203.36 K 2,826.9 M 21,115.02 M Agents Accounts Transactions Value Mobile money analysis
  • 10. Growth in mobile payments reached 8% last year, and totaled KSh3.6trn ($36bn) in value, according to newly released Central Bank of Kenya (CBK) data. While steady, the pace of expansion was slower than in 2016 and 2015, when growth rates of 19% and 17% were recorded, respectively. 0 200 400 600 800 1000 1200 1400 1600 1800 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 Trans(M) Year Trans(M) Trans(M) Marksmann Analytics2018-11-08 8,490.92 M203.36 K 2,826.9 M 21,115.02 M Agents Accounts Transactions Value Mobile money analysis