SLIDE 1
Automating our work away One consulting firms experience with - - PowerPoint PPT Presentation
Automating our work away One consulting firms experience with - - PowerPoint PPT Presentation
Automating our work away One consulting firms experience with RMarkdown Finbarr Timbers 1 2 Outline 1. About Darkhorse Analytics 2. Problems we faced 3. How we solved those problems 4. How you can improve R(Markdown) adoption 3 4 5 6
SLIDE 2
SLIDE 3
Outline
- 1. About Darkhorse Analytics
- 2. Problems we faced
- 3. How we solved those problems
- 4. How you can improve R(Markdown) adoption
3
SLIDE 4
4
SLIDE 5
5
SLIDE 6
6
SLIDE 7
Problems
7
SLIDE 8
Problems
- 1. It takes a lot of time to replicate, which is a problem when
rework happens (>50 slides!). We’ve had 3 month projects with 1 month consumed by rework.
8
SLIDE 9
Problems
- 1. It takes a lot of time to replicate, which is a problem when
rework happens (>50 slides!). We’ve had 3 month projects with 1 month consumed by rework.
- 2. All styled differently. We need to edit every plot individually.
9
SLIDE 10
Problems
- 1. It takes a lot of time to replicate, which is a problem when
rework happens (>50 slides!). We’ve had 3 month projects with 1 month consumed by rework.
- 2. All styled differently. We need to edit every plot individually.
- 3. No documentation on how to replicate.
10
SLIDE 11
Instead? R!
11
SLIDE 12
What we did:
12
SLIDE 13
What we did:
- 1. Use RMarkdown to write template (“best practice”) slides.
13
SLIDE 14
What we did:
- 1. Use RMarkdown to write template (“best practice”) slides.
- 2. Made the slides accessible to the company (we used Git +
Bitbucket).
14
SLIDE 15
What we did:
- 1. Use RMarkdown to write template (“best practice”) slides.
- 2. Made the slides accessible to the company (we used Git +
Bitbucket).
- 3. Made it easy to run in other environments (we used installation
scripts; moving to Docker)
15
SLIDE 16
What we did:
- 1. Use RMarkdown to write template (“best practice”) slides.
- 2. Made the slides accessible to the company (we used Git +
Bitbucket).
- 3. Made it easy to run in other environments (we used installation
scripts; moving to Docker)
- 4. Iterate (we used Git).
16
SLIDE 17
What we did:
- 1. Use RMarkdown to write template (“best practice”) slides.
- 2. Made the slides accessible to the company (we used Git +
Bitbucket)
- 3. Made it easy to run in other environments (we used installation
scripts; moving to Docker)
- 4. Iterate (we used Git).
- 5. Publish as a package (yet to happen).
17
SLIDE 18
R:
darkhorse_histogram = function(df, x_var, x_breaks, x_label, y_var, y_breaks, y_label, title, col="#E69F00") { ggplot(df, aes_string(x = x_var, y = y_var)) + ggtitle(title) + geom_bar(fill=col, stat = "identity") + geom_hline(yintercept= 0, colour=col) + darkhorse_theme() + ylab(y_label) + xlab(x_label) + scale_y_continuous(breaks=y_breaks) geom_hline( yintercept=y_breaks[2:length(y_breaks)], color="white") + scale_x_continuous(breaks=x_breaks) }
18
SLIDE 19
Go from. . .
19
SLIDE 20
- To. . .
2 4 6 8 10 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Minutes from Home to Station Headcount
Part Time Responders
20
SLIDE 21
Also: SQL
SELECT * FROM (SELECT CASE WHEN Call_Type NOT IN ('Medical', 'Fire', 'Fire Alarm Ringing ELSE Call_Type END AS CallType, CallID, Year FROM ERA_TFS.dbo.Calls_Template WHERE Qualified_Event = 1) t PIVOT (COUNT(CallID) FOR Year IN ([2012], [2013], [2014])) pvt
21
SLIDE 22
Vehicle Incident Fire Other Fire Alarm Ringing Medical
20000 40000 60000 2012 2013 2014
Calls
22
SLIDE 23
Lessons
- 1. Make it great.
23
SLIDE 24
Lessons
- 1. Make it great.
- 2. Make it easy.
24
SLIDE 25
Lessons
- 1. Make it great.
- 2. Make it easy.
- 3. Make it profitable.