SlideShare a Scribd company logo
Copyright (c) WLOG Solutions
Managing large (and small)
R based solutions with
R Suite
Wit Jakuczun,
WLOG Solutions
2017-09-29
Copyright (c) WLOG Solutions 2
Open-source is a leader the
race in advanced analytics
using GPU engines and power
of its community.
Copyright (c) WLOG Solutions 3
Copyright (c) WLOG Solutions 4
Example?
Copyright (c) WLOG Solutions 5
4000x4 elastic-net models (CV-5) for 45Kx10K dataset
in 1,5 minute!
Copyright (c) WLOG Solutions 6
Join 21st centuRy today!
Copyright (c) WLOG Solutions
What is R?
7
Copyright (c) WLOG Solutions 8
Dynamically interpreted
general programming language
Copyright (c) WLOG Solutions 9
Stable open-source product
developed by R Foundation
since ~1995 year.
Copyright (c) WLOG Solutions 10
Created for
data analysis.
Copyright (c) WLOG Solutions 11
flights %>%
group_by(year, month, day) %>%
select(arr_delay, dep_delay) %>%
summarise(
arr = mean(arr_delay, na.rm = TRUE),
dep = mean(dep_delay, na.rm = TRUE)
) %>%
filter(arr > 30 | dep > 30)
z <- scaled_input %>%
layer_convolution2D(c(5,5), 32, pad = TRUE) %>%
layer_max_pooling(c(3,3), c(2,2)) %>%
layer_convolution2D(c(3,3), 48) %>%
layer_max_pooling(c(3,3), c(2,2)) %>%
layer_convolution2D(c(3,3), 64) %>%
layer_dense(96) %>%
layer_dropout(0.5) %>%
layer_dense(num_output_classes,
activation = activation_softmax())
Data preparation Predictive model building
Copyright (c) WLOG Solutions 12
R is a community.
Copyright (c) WLOG Solutions 13
CRAN
10K+ packages
GitHub
more and more
popular
Copyright (c) WLOG Solutions 14
However, out-of-the-box R does not
provide many essential features required
In a large-scale production deployment!
Copyright (c) WLOG Solutions 15
R Software Development
What is a large scale?
Copyright (c) WLOG Solutions 16
R software development
vs
R scripting
Copyright (c) WLOG Solutions 17
Large scale ~ 10K+ LOC
Small scale ~ 1K LOC
Copyright (c) WLOG Solutions 18
Examples of large scale projects
Copyright (c) WLOG Solutions 19
Historical
data
Traffic
forecasting
Workforce
optimiser
Busines rules
Human intervention
Results
Efficiency
curves
Workforce optimisation
Copyright (c) WLOG Solutions 20
Historical
data
Cash flow
“forecasting”
Optimisation
phase I
Optimisation
phase II
Business rules
Human intervention
Results
FONG
Cash optimization
Copyright (c) WLOG Solutions 21
Production Dev
Continuous
integration
Version
control
R Studio Server
Data-science team
Copyright (c) WLOG Solutions 22
R Software Development
What does R give us “out-of-the-box”?
Copyright (c) WLOG Solutions 23
Dev
Version control
Continuous
Integration &
Deployment
Prod
Software development process
Copyright (c) WLOG Solutions 24
What is nice about R?
Copyright (c) WLOG Solutions 25
Package help
system
Package
dependency
system
External data in
packages
Vignettes Tests
Copyright (c) WLOG Solutions 26
Where does R have its rough edges?
Copyright (c) WLOG Solutions 27
CRAN (MRAN) Github Other
Dev environment
Installed packages
Local CRAN
Source code
repo
Copyright (c) WLOG Solutions 28
install.packages(“ggplot2”)
Copyright (c) WLOG Solutions 29
CRAN (MRAN) Github Other
Dev environment
Installed packages
Local CRAN
Source code
repo
Copyright (c) WLOG Solutions 30
Teaser
Alcohol concentration in blood
Copyright (c) WLOG SolutionsCopyright (c) WLOG Solutions 31
Instruction (Windows only!)
1. Install vanilla R 3.4.2
2. Download package
(https://goo.gl/RnZAQg)
3. Unzip
4. Open CMD
5. Rscript R/master.R 
--port=7137
6. In browser open
http://localhost:7137
http://www.sumsar.net/blog/2014/07/estimate-your-bac-using-drinkr/
Copyright (c) WLOG Solutions 32
R Software Development
R Suite walk-through
Copyright (c) WLOG Solutions 33
Preliminaries
Copyright (c) WLOG Solutions 34
Install R
https://cran.r-project.org/bin/windows/base/R-3.4.2-win.exe
Copyright (c) WLOG Solutions
Install R Suite
35
http://rsuite.io/RSuite_Download.php
Copyright (c) WLOG Solutions
Development cycle with R Suite
36
1. Start a project
2. Add a package to the project
a. Develop the package (using devtools)
3. Add dependencies to the project
4. Build the package
5. Build a deployment package
Copyright (c) WLOG Solutions 37
Open tutorial
http://rsuite.io/RSuite_Tutorial.php?article=basic_workflow.md
Copyright (c) WLOG Solutions 38
Copyright (c) WLOG Solutions 39
Project structure
Copyright (c) WLOG Solutions 40
deployment
logs
packages
R
tests
import
export
work
Where all the
packages are
installed.
Copyright (c) WLOG Solutions 41
deployment
logs
packages
R
tests
import
export
work
Where all the logs
are stored.
Copyright (c) WLOG Solutions 42
deployment
logs
packages
R
tests
import
export
work
Where all the
project packages
are stored.
Copyright (c) WLOG Solutions 43
deployment
logs
packages
R
tests
import
export
work
Where master
scripts (~ main) are
stored.
Copyright (c) WLOG Solutions 44
deployment
logs
packages
R
tests
import
export
work
Where project tests
are stored.
Copyright (c) WLOG Solutions 45
deployment
logs
packages
R
tests
import
export
work
(Optional)
Raw data to be
imported.
Copyright (c) WLOG Solutions 46
deployment
logs
packages
R
tests
import
export
work
(Optional)
Results generated
by our R program.
Copyright (c) WLOG Solutions 47
deployment
logs
packages
R
tests
import
export
work
(Optional)
Temporary results.
Copyright (c) WLOG Solutions 48
Configuration files.
Copyright (c) WLOG Solutions 49
RSuiteVersion: 0.10.212
RVersion: 3.3
Project: myproject
Repositories: MRAN[2017-09-28],
Dir[]
Artifacts: config_templ.txt
Example
PARAMETERS
● RVersion - R version for this
project
● Project - project name
● Repositories
○ MRAN[YYYY-MM-DD],
○ S3[URL]
○ URL[URL]
○ Dir[]
● Artifacts - what else should be
added to deployment
package.
Copyright (c) WLOG Solutions 50
LogLevel: INFO
N_days: 365
solver_max_iterations: 10
solver_opt_horizon: 8
Example
config_templ.txt (config.txt)
● LogLevel - level for loggers
● _templ.txt - template for config
● config.txt - deployment version
Copyright (c) WLOG Solutions 51
Copyright (c) WLOG Solutions 52
master.R
Here goes your code...
Autodected path
of master.R
There can be many master
scripts!
Copyright (c) WLOG Solutions 53
Put all logic into packages
Copyright (c) WLOG Solutions 54
Copyright (c) WLOG Solutions 55
Select external packages carefully.
And control their versions!
Copyright (c) WLOG Solutions 56
data.table
Copyright (c) WLOG Solutions 57
Copyright (c) WLOG Solutions 58
print is not for logging.
Forbidden
Copyright (c) WLOG Solutions 59
loginfo("Phase 1 passed")
logdebug("Iter %d done", i)
logwarning("Are you sure?")
logerror("I failed :(")
Copyright (c) WLOG Solutions 60
pkg_loginfo("Phase 1 passed")
pkg_logdebug("Iter %d done", i)
pkg_logwarning("Are you sure?")
pkg_logerror("I failed :(")
Copyright (c) WLOG Solutions 61
Automate building, deploying, testing,
etc.
Copyright (c) WLOG Solutions
Wit Jakuczun, PhD
wit.jakuczun@wlogsolutions.com
62
Field tested R ecosystem for Enterprise
http://rsuite.io

More Related Content

What's hot (20)

PDF
On the Role of the GRAPH Clause in the Performance of Federated SPARQL Queries
David Chaves-Fraga
 
PDF
This Helix Nebula Science Cloud Pilot Phase Open Session
Helix Nebula The Science Cloud
 
PDF
How Do You Build and Validate 1500 Models and What Can You Learn from Them?
Greg Landrum
 
PPTX
OpenACC Monthly Highlights: February 2022
OpenACC
 
PPTX
NLP2API: Replication package accepted by ICSME 2018
Masud Rahman
 
PPTX
OpenACC Monthly Highlights: June 2020
OpenACC
 
PPTX
Integration of static and dynamic analysis for understanding legacy source code
Michael Moser
 
PPTX
OpenACC Monthly Highlights: July 2021
OpenACC
 
PDF
On unifying query languages for RDF streams
Daniele Dell'Aglio
 
PPTX
OpenACC Highlights: 2019 Year in Review
OpenACC
 
PPTX
OpenACC Monthly Highlights: March 2021
OpenACC
 
PPTX
OpenACC Monthly Highlights: August 2020
OpenACC
 
PDF
The Past, Present, and Future of OpenACC
inside-BigData.com
 
PPTX
OpenACC Monthly Highlights: June 2021
OpenACC
 
PPTX
OpenACC Highlights: GTC Digital April 2020
OpenACC
 
PPTX
OpenACC Monthly Highlights: May 2019
OpenACC
 
PDF
ACS San Diego - The RDKit: Open-source cheminformatics
Greg Landrum
 
PPTX
Quick and Dirty: Scaling Out Predictive Models Using Revolution Analytics on ...
Revolution Analytics
 
PPTX
OpenACC Monthly Highlights: February 2021
OpenACC
 
PDF
IJCAR 2018 keynote: Industrial Data Access
Martin Giese
 
On the Role of the GRAPH Clause in the Performance of Federated SPARQL Queries
David Chaves-Fraga
 
This Helix Nebula Science Cloud Pilot Phase Open Session
Helix Nebula The Science Cloud
 
How Do You Build and Validate 1500 Models and What Can You Learn from Them?
Greg Landrum
 
OpenACC Monthly Highlights: February 2022
OpenACC
 
NLP2API: Replication package accepted by ICSME 2018
Masud Rahman
 
OpenACC Monthly Highlights: June 2020
OpenACC
 
Integration of static and dynamic analysis for understanding legacy source code
Michael Moser
 
OpenACC Monthly Highlights: July 2021
OpenACC
 
On unifying query languages for RDF streams
Daniele Dell'Aglio
 
OpenACC Highlights: 2019 Year in Review
OpenACC
 
OpenACC Monthly Highlights: March 2021
OpenACC
 
OpenACC Monthly Highlights: August 2020
OpenACC
 
The Past, Present, and Future of OpenACC
inside-BigData.com
 
OpenACC Monthly Highlights: June 2021
OpenACC
 
OpenACC Highlights: GTC Digital April 2020
OpenACC
 
OpenACC Monthly Highlights: May 2019
OpenACC
 
ACS San Diego - The RDKit: Open-source cheminformatics
Greg Landrum
 
Quick and Dirty: Scaling Out Predictive Models Using Revolution Analytics on ...
Revolution Analytics
 
OpenACC Monthly Highlights: February 2021
OpenACC
 
IJCAR 2018 keynote: Industrial Data Access
Martin Giese
 

Similar to Managing large (and small) R based solutions with R Suite (20)

PDF
Managing large scale projects in R with R Suite
WLOG Solutions
 
PDF
Always Be Deploying. How to make R great for machine learning in (not only) E...
Wit Jakuczun
 
PPTX
Meet a 100% R-based CRO. The summary of a 5-year journey
Adrian Olszewski
 
PPTX
Meet a 100% R-based CRO - The summary of a 5-year journey
Adrian Olszewski
 
PDF
R development
helloapurba
 
PPTX
Reproducible Computational Research in R
Samuel Bosch
 
PDF
Unit1_Introduction to R.pdf
MDDidarulAlam15
 
PDF
Devtools cheatsheet
Dieudonne Nahigombeye
 
PDF
Devtools cheatsheet
Dr. Volkan OBAN
 
PPTX
Getting Started with R
Sankhya_Analytics
 
PPTX
R and Rcmdr Statistical Software
arttan2001
 
PPTX
A Step Towards Reproducibility in R
Revolution Analytics
 
PDF
Putting data science to work
Alex Breeze
 
PDF
Data Science - Part II - Working with R & R studio
Derek Kane
 
PDF
MLflow with R
Databricks
 
PDF
Data Analysis and Visualization: R Workflow
Olga Scrivner
 
PPT
An introduction to R is a document useful
ssuser3c3f88
 
PPTX
R programming presentation
Akshat Sharma
 
PDF
Introduction to R software, by Leire ibaibarriaga
DTU - Technical University of Denmark
 
PPTX
Workshop presentation hands on r programming
Nimrita Koul
 
Managing large scale projects in R with R Suite
WLOG Solutions
 
Always Be Deploying. How to make R great for machine learning in (not only) E...
Wit Jakuczun
 
Meet a 100% R-based CRO. The summary of a 5-year journey
Adrian Olszewski
 
Meet a 100% R-based CRO - The summary of a 5-year journey
Adrian Olszewski
 
R development
helloapurba
 
Reproducible Computational Research in R
Samuel Bosch
 
Unit1_Introduction to R.pdf
MDDidarulAlam15
 
Devtools cheatsheet
Dieudonne Nahigombeye
 
Devtools cheatsheet
Dr. Volkan OBAN
 
Getting Started with R
Sankhya_Analytics
 
R and Rcmdr Statistical Software
arttan2001
 
A Step Towards Reproducibility in R
Revolution Analytics
 
Putting data science to work
Alex Breeze
 
Data Science - Part II - Working with R & R studio
Derek Kane
 
MLflow with R
Databricks
 
Data Analysis and Visualization: R Workflow
Olga Scrivner
 
An introduction to R is a document useful
ssuser3c3f88
 
R programming presentation
Akshat Sharma
 
Introduction to R software, by Leire ibaibarriaga
DTU - Technical University of Denmark
 
Workshop presentation hands on r programming
Nimrita Koul
 
Ad

More from Wit Jakuczun (10)

PDF
recommendation = optimization(prediction)
Wit Jakuczun
 
PDF
Driving your marketing automation with multi-armed bandits in real time
Wit Jakuczun
 
PDF
Large scale machine learning projects with r suite
Wit Jakuczun
 
PDF
20170928 why r_r jako główna platforma do zaawansowanej analityki w enterprise
Wit Jakuczun
 
PDF
Wit jakuczun dss_conf_2017_jak_wdrazac_r_w_enterprise
Wit Jakuczun
 
PDF
ANALYTICS WITHOUT LOSS OF GENERALITY
Wit Jakuczun
 
PDF
Showcase: on segmentation importance for marketing campaign in retail using R...
Wit Jakuczun
 
PDF
20150521 ser protecto_r_final
Wit Jakuczun
 
PDF
Rozwiązywanie problemów optymalizacyjnych (z przykładem w R)
Wit Jakuczun
 
PDF
R+H2O - idealny tandem do analityki predykcyjnej?
Wit Jakuczun
 
recommendation = optimization(prediction)
Wit Jakuczun
 
Driving your marketing automation with multi-armed bandits in real time
Wit Jakuczun
 
Large scale machine learning projects with r suite
Wit Jakuczun
 
20170928 why r_r jako główna platforma do zaawansowanej analityki w enterprise
Wit Jakuczun
 
Wit jakuczun dss_conf_2017_jak_wdrazac_r_w_enterprise
Wit Jakuczun
 
ANALYTICS WITHOUT LOSS OF GENERALITY
Wit Jakuczun
 
Showcase: on segmentation importance for marketing campaign in retail using R...
Wit Jakuczun
 
20150521 ser protecto_r_final
Wit Jakuczun
 
Rozwiązywanie problemów optymalizacyjnych (z przykładem w R)
Wit Jakuczun
 
R+H2O - idealny tandem do analityki predykcyjnej?
Wit Jakuczun
 
Ad

Recently uploaded (20)

PPTX
GenAI-Introduction-to-Copilot-for-Bing-March-2025-FOR-HUB.pptx
cleydsonborges1
 
PDF
Context Engineering vs. Prompt Engineering, A Comprehensive Guide.pdf
Tamanna
 
PPTX
Exploring Multilingual Embeddings for Italian Semantic Search: A Pretrained a...
Sease
 
PPTX
AI Project Cycle and Ethical Frameworks.pptx
RiddhimaVarshney1
 
PPTX
加拿大尼亚加拉学院毕业证书{Niagara在读证明信Niagara成绩单修改}复刻
Taqyea
 
PPTX
Numbers of a nation: how we estimate population statistics | Accessible slides
Office for National Statistics
 
PPTX
apidays Munich 2025 - Building Telco-Aware Apps with Open Gateway APIs, Subhr...
apidays
 
PDF
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
PPTX
Resmed Rady Landis May 4th - analytics.pptx
Adrian Limanto
 
PPTX
Hadoop_EcoSystem slide by CIDAC India.pptx
migbaruget
 
PPT
1 DATALINK CONTROL and it's applications
karunanidhilithesh
 
PPTX
apidays Munich 2025 - Building an AWS Serverless Application with Terraform, ...
apidays
 
PDF
R Cookbook - Processing and Manipulating Geological spatial data with R.pdf
OtnielSimopiaref2
 
PPTX
Slide studies GC- CRC - PC - HNC baru.pptx
LLen8
 
PPTX
Climate Action.pptx action plan for climate
justfortalabat
 
DOCX
AI/ML Applications in Financial domain projects
Rituparna De
 
PDF
MusicVideoProjectRubric Animation production music video.pdf
ALBERTIANCASUGA
 
PDF
Choosing the Right Database for Indexing.pdf
Tamanna
 
PPTX
This PowerPoint presentation titled "Data Visualization: Turning Data into In...
HemaDivyaKantamaneni
 
PDF
What does good look like - CRAP Brighton 8 July 2025
Jan Kierzyk
 
GenAI-Introduction-to-Copilot-for-Bing-March-2025-FOR-HUB.pptx
cleydsonborges1
 
Context Engineering vs. Prompt Engineering, A Comprehensive Guide.pdf
Tamanna
 
Exploring Multilingual Embeddings for Italian Semantic Search: A Pretrained a...
Sease
 
AI Project Cycle and Ethical Frameworks.pptx
RiddhimaVarshney1
 
加拿大尼亚加拉学院毕业证书{Niagara在读证明信Niagara成绩单修改}复刻
Taqyea
 
Numbers of a nation: how we estimate population statistics | Accessible slides
Office for National Statistics
 
apidays Munich 2025 - Building Telco-Aware Apps with Open Gateway APIs, Subhr...
apidays
 
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
Resmed Rady Landis May 4th - analytics.pptx
Adrian Limanto
 
Hadoop_EcoSystem slide by CIDAC India.pptx
migbaruget
 
1 DATALINK CONTROL and it's applications
karunanidhilithesh
 
apidays Munich 2025 - Building an AWS Serverless Application with Terraform, ...
apidays
 
R Cookbook - Processing and Manipulating Geological spatial data with R.pdf
OtnielSimopiaref2
 
Slide studies GC- CRC - PC - HNC baru.pptx
LLen8
 
Climate Action.pptx action plan for climate
justfortalabat
 
AI/ML Applications in Financial domain projects
Rituparna De
 
MusicVideoProjectRubric Animation production music video.pdf
ALBERTIANCASUGA
 
Choosing the Right Database for Indexing.pdf
Tamanna
 
This PowerPoint presentation titled "Data Visualization: Turning Data into In...
HemaDivyaKantamaneni
 
What does good look like - CRAP Brighton 8 July 2025
Jan Kierzyk
 

Managing large (and small) R based solutions with R Suite

  • 1. Copyright (c) WLOG Solutions Managing large (and small) R based solutions with R Suite Wit Jakuczun, WLOG Solutions 2017-09-29
  • 2. Copyright (c) WLOG Solutions 2 Open-source is a leader the race in advanced analytics using GPU engines and power of its community.
  • 3. Copyright (c) WLOG Solutions 3
  • 4. Copyright (c) WLOG Solutions 4 Example?
  • 5. Copyright (c) WLOG Solutions 5 4000x4 elastic-net models (CV-5) for 45Kx10K dataset in 1,5 minute!
  • 6. Copyright (c) WLOG Solutions 6 Join 21st centuRy today!
  • 7. Copyright (c) WLOG Solutions What is R? 7
  • 8. Copyright (c) WLOG Solutions 8 Dynamically interpreted general programming language
  • 9. Copyright (c) WLOG Solutions 9 Stable open-source product developed by R Foundation since ~1995 year.
  • 10. Copyright (c) WLOG Solutions 10 Created for data analysis.
  • 11. Copyright (c) WLOG Solutions 11 flights %>% group_by(year, month, day) %>% select(arr_delay, dep_delay) %>% summarise( arr = mean(arr_delay, na.rm = TRUE), dep = mean(dep_delay, na.rm = TRUE) ) %>% filter(arr > 30 | dep > 30) z <- scaled_input %>% layer_convolution2D(c(5,5), 32, pad = TRUE) %>% layer_max_pooling(c(3,3), c(2,2)) %>% layer_convolution2D(c(3,3), 48) %>% layer_max_pooling(c(3,3), c(2,2)) %>% layer_convolution2D(c(3,3), 64) %>% layer_dense(96) %>% layer_dropout(0.5) %>% layer_dense(num_output_classes, activation = activation_softmax()) Data preparation Predictive model building
  • 12. Copyright (c) WLOG Solutions 12 R is a community.
  • 13. Copyright (c) WLOG Solutions 13 CRAN 10K+ packages GitHub more and more popular
  • 14. Copyright (c) WLOG Solutions 14 However, out-of-the-box R does not provide many essential features required In a large-scale production deployment!
  • 15. Copyright (c) WLOG Solutions 15 R Software Development What is a large scale?
  • 16. Copyright (c) WLOG Solutions 16 R software development vs R scripting
  • 17. Copyright (c) WLOG Solutions 17 Large scale ~ 10K+ LOC Small scale ~ 1K LOC
  • 18. Copyright (c) WLOG Solutions 18 Examples of large scale projects
  • 19. Copyright (c) WLOG Solutions 19 Historical data Traffic forecasting Workforce optimiser Busines rules Human intervention Results Efficiency curves Workforce optimisation
  • 20. Copyright (c) WLOG Solutions 20 Historical data Cash flow “forecasting” Optimisation phase I Optimisation phase II Business rules Human intervention Results FONG Cash optimization
  • 21. Copyright (c) WLOG Solutions 21 Production Dev Continuous integration Version control R Studio Server Data-science team
  • 22. Copyright (c) WLOG Solutions 22 R Software Development What does R give us “out-of-the-box”?
  • 23. Copyright (c) WLOG Solutions 23 Dev Version control Continuous Integration & Deployment Prod Software development process
  • 24. Copyright (c) WLOG Solutions 24 What is nice about R?
  • 25. Copyright (c) WLOG Solutions 25 Package help system Package dependency system External data in packages Vignettes Tests
  • 26. Copyright (c) WLOG Solutions 26 Where does R have its rough edges?
  • 27. Copyright (c) WLOG Solutions 27 CRAN (MRAN) Github Other Dev environment Installed packages Local CRAN Source code repo
  • 28. Copyright (c) WLOG Solutions 28 install.packages(“ggplot2”)
  • 29. Copyright (c) WLOG Solutions 29 CRAN (MRAN) Github Other Dev environment Installed packages Local CRAN Source code repo
  • 30. Copyright (c) WLOG Solutions 30 Teaser Alcohol concentration in blood
  • 31. Copyright (c) WLOG SolutionsCopyright (c) WLOG Solutions 31 Instruction (Windows only!) 1. Install vanilla R 3.4.2 2. Download package (https://goo.gl/RnZAQg) 3. Unzip 4. Open CMD 5. Rscript R/master.R --port=7137 6. In browser open http://localhost:7137 http://www.sumsar.net/blog/2014/07/estimate-your-bac-using-drinkr/
  • 32. Copyright (c) WLOG Solutions 32 R Software Development R Suite walk-through
  • 33. Copyright (c) WLOG Solutions 33 Preliminaries
  • 34. Copyright (c) WLOG Solutions 34 Install R https://cran.r-project.org/bin/windows/base/R-3.4.2-win.exe
  • 35. Copyright (c) WLOG Solutions Install R Suite 35 http://rsuite.io/RSuite_Download.php
  • 36. Copyright (c) WLOG Solutions Development cycle with R Suite 36 1. Start a project 2. Add a package to the project a. Develop the package (using devtools) 3. Add dependencies to the project 4. Build the package 5. Build a deployment package
  • 37. Copyright (c) WLOG Solutions 37 Open tutorial http://rsuite.io/RSuite_Tutorial.php?article=basic_workflow.md
  • 38. Copyright (c) WLOG Solutions 38
  • 39. Copyright (c) WLOG Solutions 39 Project structure
  • 40. Copyright (c) WLOG Solutions 40 deployment logs packages R tests import export work Where all the packages are installed.
  • 41. Copyright (c) WLOG Solutions 41 deployment logs packages R tests import export work Where all the logs are stored.
  • 42. Copyright (c) WLOG Solutions 42 deployment logs packages R tests import export work Where all the project packages are stored.
  • 43. Copyright (c) WLOG Solutions 43 deployment logs packages R tests import export work Where master scripts (~ main) are stored.
  • 44. Copyright (c) WLOG Solutions 44 deployment logs packages R tests import export work Where project tests are stored.
  • 45. Copyright (c) WLOG Solutions 45 deployment logs packages R tests import export work (Optional) Raw data to be imported.
  • 46. Copyright (c) WLOG Solutions 46 deployment logs packages R tests import export work (Optional) Results generated by our R program.
  • 47. Copyright (c) WLOG Solutions 47 deployment logs packages R tests import export work (Optional) Temporary results.
  • 48. Copyright (c) WLOG Solutions 48 Configuration files.
  • 49. Copyright (c) WLOG Solutions 49 RSuiteVersion: 0.10.212 RVersion: 3.3 Project: myproject Repositories: MRAN[2017-09-28], Dir[] Artifacts: config_templ.txt Example PARAMETERS ● RVersion - R version for this project ● Project - project name ● Repositories ○ MRAN[YYYY-MM-DD], ○ S3[URL] ○ URL[URL] ○ Dir[] ● Artifacts - what else should be added to deployment package.
  • 50. Copyright (c) WLOG Solutions 50 LogLevel: INFO N_days: 365 solver_max_iterations: 10 solver_opt_horizon: 8 Example config_templ.txt (config.txt) ● LogLevel - level for loggers ● _templ.txt - template for config ● config.txt - deployment version
  • 51. Copyright (c) WLOG Solutions 51
  • 52. Copyright (c) WLOG Solutions 52 master.R Here goes your code... Autodected path of master.R There can be many master scripts!
  • 53. Copyright (c) WLOG Solutions 53 Put all logic into packages
  • 54. Copyright (c) WLOG Solutions 54
  • 55. Copyright (c) WLOG Solutions 55 Select external packages carefully. And control their versions!
  • 56. Copyright (c) WLOG Solutions 56 data.table
  • 57. Copyright (c) WLOG Solutions 57
  • 58. Copyright (c) WLOG Solutions 58 print is not for logging. Forbidden
  • 59. Copyright (c) WLOG Solutions 59 loginfo("Phase 1 passed") logdebug("Iter %d done", i) logwarning("Are you sure?") logerror("I failed :(")
  • 60. Copyright (c) WLOG Solutions 60 pkg_loginfo("Phase 1 passed") pkg_logdebug("Iter %d done", i) pkg_logwarning("Are you sure?") pkg_logerror("I failed :(")
  • 61. Copyright (c) WLOG Solutions 61 Automate building, deploying, testing, etc.
  • 62. Copyright (c) WLOG Solutions Wit Jakuczun, PhD [email protected] 62 Field tested R ecosystem for Enterprise http://rsuite.io