SlideShare a Scribd company logo
R, Git, Github, and 
CI 
TTaaiiwwaann RR UUsseerr GGrroouupp 
WWuusshh WWuu 
22001144--0099--2200
DSC 2014 
● 2014 is the first year of DSC(Data Science 
Conference) in Taiwan. 
● We (Taiwan R User Group) organizes the Tutorial 
Program of R in DSC. 
● There were more than 100 students joined us during 
DSC 2014. 
● The averaged rating is more than 4.2 (1 ~ 5).
Goal of Tutorial 
● Systematically introduce the analysis step with R 
– Basic 
– Data Manipulation(Extract, Transform and Loading) 
– Analysis 
– Visualization 
● Based on the latest tools of R 
● Reproducibility of examples 
● Integration of materials 
● *Well designed exercises
About Me 
● PhD Candidate in NTU EE 
● Current research field: 
– Online Advertisement 
– Large Scale Predictive Modeling 
● Organizer of Taiwan R User Group 
● Organizer of Tutorial Program in DSC 2014
Outline 
● Share the experience of organizing tutorial program 
with 16 people with: 
– Git, my favorite tool of version control 
– Github, a platform of cooperation 
– Jenkins, a system of automation 
● I will show how to cooperate these tools with R 
package
Why R Package 
● There are many dependency for examples and exercises 
● R package is the recommended way to share your code 
● Wrap all materials in one R Package: DSC2014Tutorial so the 
students only need to download once. 
– All slides are included. 
– Customized R API 
– All data 
– *Installation of depended packages 
– Solving issue of portability(Windows, Mac, and Ubuntu) 
● The package is easily managed by git and released on github
The structure of R package 
Dependencies 
● DESCRIPTION 
Package: DSC2014Tutorial 
Type: Package 
Title: Materials of Tutorial Program on 
DSC 2014 
Version: 1.2 
Date: 2014-08-03 
Author: Taiwan R User Group 
Maintainer: Wush Wu <wush978@gmail.com> 
Description: This package contains the 
required materials of R Tutorial 
DSC2014 
License: GPL (>= 3) 
Depends: 
R (>= 3.1.0) 
Imports: 
tools, 
...
The structure of R package 
Data 
● data 
data(salary, package = 'DSC2014Tutorial')
The structure of R package 
cross-platform 
● configure.ac / configure
The structure of R package 
slides and external source 
system.file('Basic', package = 
'DSC2014Tutorial')
Git, Version Control 
● Some speakers are new to git 
● We used the following feature: 
– Self version control: add, commit 
– Repository: remote, push, pull, and merge 
– Cooperation: submodul 
● Git plays the fundamental role in our workflow
Why Git? 
● Speed is king 
● Local commits rock 
● Github 
●My favorite
Github 
● Most popular platform for managing git 
repository 
● Provide many convenient features 
– Account of Organization 
– Designed for cooperation 
– Simple integration with many popular CI tools 
– Static website (Sufficient for R Repository)
Release R Package on Github 
● R is released as: 
– a git repository 
– a R repository
Github and R Repository 
● How to establish a R repository on github: 
1.Create a new git repository named 『R』 
2.Add the content of R repository into git repository in 
branch gghh--ppaaggeess 
3. Push and wait 
4. The R Repository is located at http://<account>.github.io/R 
● The user could install the binary of DSC2014Tutorial 
directly via 
install.packages(DSC2014Tutorial, repos = 
"http://TaiwanRUserGroup.github.io/R")
Cooperation 
● I cannot build all slides of tutorial 
– There are 7 slides built from different groups of speakers 
● Each slides should be managed by its author 
– Each slides is a standalone git repository 
– No branching here because not all speakers are familiear with 
git 
● Use gitsubmodule to embed these slides into R Package 
● We need modern work flow to control the quality
Workflow 1 
1.Each speakers creates the slides and initialize the git 
repository 
2.Speakers commit their changes to git repository 
3.Open the pull request 
4.Slide review and test on different platform 
5.Merge changes to DSC2014Tutorial
Commits
Pull Requests
Review
Merge
Slide Review 
● Each speakers review the slides of each others 
● The comment are posted to Issue of the github pages 
● The speaker should resolve the posted issue
Issues
Challenge 
● After the first rehearsal on Taiwan R User Group, 
we notice a serious encoding issue 
– Default chinese encoding is different
Challenge 
● We could resolve the specific issue 
● The slides are evolving, some bugs might occur 
● We need to test the slides, but there are 7 slides and 
we want to test them on Windows, ubuntu and mac*
Why CI 
● CI automates the following things 
– Testing 
– Integration 
– Deployment 
● CI makes me a better life 
● CI also introduces some problems. Let's discuss it 
later.
Test R Package 
● R CMD check --no-codoc --no-manual --no-vignettes 
–no-build-vignettes
Deploy R Package 
● git push 
● Commit to R Repository 
tools::write_PACKAGES( type = c("source", 
"mac.binary", "win.binary") )
R and CI 
travis-ci.org
Existed work for R and Travis-ci 
● https://github.com/craigcitro/r-travis/wiki
travis.yml 
language: c 
script: ./travis-tool.sh run_tests 
after_failure: 
- ./travis-tool.sh dump_logs 
before_install: 
- curl -OL http://raw.github.com/craigcitro/r-travis/ 
master/scripts/travis-tool.sh 
- chmod 755 ./travis-tool.sh 
- ./travis-tool.sh bootstrap 
- ./travis-tool.sh r_binary_install XML Rcpp knitr 
brew RUnit inline highlight formatR highr markdown rgl 
install: 
- ./travis-tool.sh install_deps 
- ./travis-tool.sh install_github hadley/testthat 
notifications: 
email: 
on_success: change 
on_failure: change 
env:
R and CI 
jenkins
Setup Jenkins 
● Github Plugin 
– http://sanketdangi.com/post/62740311628/integrate-jenkins- 
github-trigger-build-process 
● Github Pull Request Builder 
– http://www.kabisa.nl/building-github-pull-requests-with-jenkins/ 
● Firewall (open to 192.30.252.0/22)
Auto Testing
Result
Discussion 
● No Error v.s. No Warnings 
● Existed Problems: 
– Memory issue 
– Unknown Bugs 
– Unclear Message
Summary 
● Tutorial and R Package 
● Git and R Package 
● Github and R Package 
● CI and R Package
Q&A
Thanks for your listening

More Related Content

PPTX
Cinder Project On-Boarding - OpenInfra Summit Denver 2019
PDF
OpenStack Cinder On-Boarding Education - Boston Summit - 2017
PPTX
Cinder On-boarding Room - Berlin (11-13-2018)
PPTX
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
PDF
ElasTest Webinar
PDF
Android build process (1)
PDF
Migrating python.org to buildbot 9 and python 3
PDF
Continuous Integration/Deployment with Gitlab CI
Cinder Project On-Boarding - OpenInfra Summit Denver 2019
OpenStack Cinder On-Boarding Education - Boston Summit - 2017
Cinder On-boarding Room - Berlin (11-13-2018)
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
ElasTest Webinar
Android build process (1)
Migrating python.org to buildbot 9 and python 3
Continuous Integration/Deployment with Gitlab CI

What's hot (20)

PDF
Life-cycle is too short not to use ElasTest
PDF
Building and Deploying containerized Python Apps in the Cloud
PDF
BKK16-215 kernelci.org: beyond boot testing
PDF
PDF
Default GitLab CI Pipeline - Auto DevOps
PDF
Python deployments on OpenShift 3
PDF
LCE13: Test and Validation Mini-Summit: Review Current Linaro Engineering Pro...
PDF
SFO15-203: Linaro CI - git driven workflow & Jenkins advanced usage
PDF
Introduction of Distributed version control system (mainly Mercurial)
PPTX
The New York Times: Sustainable Systems, Powered by Python
PDF
Influxdays Opentracing
PDF
Using GitLab CI
PPTX
Optimizing and Profiling Golang Rest Api
ODP
Embedded recipes 2018 - End-to-end software production for embedded - Guy Lun...
DOC
Uop ntc 324 entire course new
PDF
Devops Porto - CI/CD at Gitlab
DOCX
Angular 4 Training | Angular Js training in Hyderabad
PDF
This Week in Neo4j - 6th October 2018
PDF
State of Big Data on ARM64 / AArch64 - Apache Bigtop
PPTX
QA methodology by Quality Tech
Life-cycle is too short not to use ElasTest
Building and Deploying containerized Python Apps in the Cloud
BKK16-215 kernelci.org: beyond boot testing
Default GitLab CI Pipeline - Auto DevOps
Python deployments on OpenShift 3
LCE13: Test and Validation Mini-Summit: Review Current Linaro Engineering Pro...
SFO15-203: Linaro CI - git driven workflow & Jenkins advanced usage
Introduction of Distributed version control system (mainly Mercurial)
The New York Times: Sustainable Systems, Powered by Python
Influxdays Opentracing
Using GitLab CI
Optimizing and Profiling Golang Rest Api
Embedded recipes 2018 - End-to-end software production for embedded - Guy Lun...
Uop ntc 324 entire course new
Devops Porto - CI/CD at Gitlab
Angular 4 Training | Angular Js training in Hyderabad
This Week in Neo4j - 6th October 2018
State of Big Data on ARM64 / AArch64 - Apache Bigtop
QA methodology by Quality Tech
Ad

Viewers also liked (20)

PDF
社群對我職涯的影響
PPTX
Kairu
PPTX
Making greek christmas chocolate treats for our friends
PPTX
20150923 mindtrek korhonen taltioni
PDF
الإهمال الطبي والقتل البطئ والإعدام ..واقع نساء مصر في سجون الانقلاب !
PDF
Kuopion ideaklinikka tavoitetila hankinnalle 012015
PPT
Week 1 risen the jesus you never knew 515pm media
ODP
Essential Tips For Building An Ecommerce Website
PDF
March 27 2016 HIS LAMBS
PDF
The 2nd Games for Health Finland event - Koopee Hiltunen
PDF
تقريريرصدالانتهاكات بحق المرأة - في الفترة من3يوليو2013حتي نوفمبر2015
PPTX
Центральний банк в банківській системі України
PDF
ملخص تقرير نساء ضد الانقلاب - عامين علي الانقلاب العسكري
PDF
Nopeilla kokeiluilla uusia hyvinvointi- ja terveysinnovaatiota, Case Kuopio
PDF
Rabaa Massacre | 2 years on (English report)
PPT
Risen 1
社群對我職涯的影響
Kairu
Making greek christmas chocolate treats for our friends
20150923 mindtrek korhonen taltioni
الإهمال الطبي والقتل البطئ والإعدام ..واقع نساء مصر في سجون الانقلاب !
Kuopion ideaklinikka tavoitetila hankinnalle 012015
Week 1 risen the jesus you never knew 515pm media
Essential Tips For Building An Ecommerce Website
March 27 2016 HIS LAMBS
The 2nd Games for Health Finland event - Koopee Hiltunen
تقريريرصدالانتهاكات بحق المرأة - في الفترة من3يوليو2013حتي نوفمبر2015
Центральний банк в банківській системі України
ملخص تقرير نساء ضد الانقلاب - عامين علي الانقلاب العسكري
Nopeilla kokeiluilla uusia hyvinvointi- ja terveysinnovaatiota, Case Kuopio
Rabaa Massacre | 2 years on (English report)
Risen 1
Ad

Similar to R, Git, Github, and CI (20)

PPTX
Git within RStudio
PPTX
R Consortium Update for EARL June 2017
PPTX
Reproducible Computational Research in R
PDF
R Consortium update for EARL Boston Oct 2017
PDF
EARL Sept 2016 R consortium
PDF
How to install & update R packages?
PDF
R consortium update EARL London Sept 2017
PDF
Version Control With GitHub & RStudio
PPTX
Creating R Packages
PPTX
R reproducibility
PPTX
A Step Towards Reproducibility in R
PDF
Introduction to R software, by Leire ibaibarriaga
PDF
Putting data science to work
PPTX
Reproducibility with Checkpoint & RRO - NYC R Conference
PPTX
Reproducibility with Checkpoint & RRO
PDF
R ext world/ useR! Kiev
PDF
Managing large (and small) R based solutions with R Suite
PDF
PPTX
Analysing GitHub commits with R
PPTX
Introduction to r
Git within RStudio
R Consortium Update for EARL June 2017
Reproducible Computational Research in R
R Consortium update for EARL Boston Oct 2017
EARL Sept 2016 R consortium
How to install & update R packages?
R consortium update EARL London Sept 2017
Version Control With GitHub & RStudio
Creating R Packages
R reproducibility
A Step Towards Reproducibility in R
Introduction to R software, by Leire ibaibarriaga
Putting data science to work
Reproducibility with Checkpoint & RRO - NYC R Conference
Reproducibility with Checkpoint & RRO
R ext world/ useR! Kiev
Managing large (and small) R based solutions with R Suite
Analysing GitHub commits with R
Introduction to r

More from Wush Wu (7)

PDF
Predicting winning price in real time bidding
PDF
機器學習的技術債
PDF
R 語言上手篇
PDF
利用免費服務建立R的持續整合環境
PDF
Predicting Winning Price in Real Time Bidding with Censored Data
PDF
Introduction of Feature Hashing
ODP
Online advertising and large scale model fitting
Predicting winning price in real time bidding
機器學習的技術債
R 語言上手篇
利用免費服務建立R的持續整合環境
Predicting Winning Price in Real Time Bidding with Censored Data
Introduction of Feature Hashing
Online advertising and large scale model fitting

Recently uploaded (20)

PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPT
Mechanical Engineering MATERIALS Selection
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Sustainable Sites - Green Building Construction
PPTX
Geodesy 1.pptx...............................................
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
PPT on Performance Review to get promotions
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
web development for engineering and engineering
PPTX
Foundation to blockchain - A guide to Blockchain Tech
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
DOCX
573137875-Attendance-Management-System-original
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
bas. eng. economics group 4 presentation 1.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Mechanical Engineering MATERIALS Selection
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
OOP with Java - Java Introduction (Basics)
Internet of Things (IOT) - A guide to understanding
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Sustainable Sites - Green Building Construction
Geodesy 1.pptx...............................................
Model Code of Practice - Construction Work - 21102022 .pdf
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPT on Performance Review to get promotions
CH1 Production IntroductoryConcepts.pptx
web development for engineering and engineering
Foundation to blockchain - A guide to Blockchain Tech
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
573137875-Attendance-Management-System-original

R, Git, Github, and CI

  • 1. R, Git, Github, and CI TTaaiiwwaann RR UUsseerr GGrroouupp WWuusshh WWuu 22001144--0099--2200
  • 2. DSC 2014 ● 2014 is the first year of DSC(Data Science Conference) in Taiwan. ● We (Taiwan R User Group) organizes the Tutorial Program of R in DSC. ● There were more than 100 students joined us during DSC 2014. ● The averaged rating is more than 4.2 (1 ~ 5).
  • 3. Goal of Tutorial ● Systematically introduce the analysis step with R – Basic – Data Manipulation(Extract, Transform and Loading) – Analysis – Visualization ● Based on the latest tools of R ● Reproducibility of examples ● Integration of materials ● *Well designed exercises
  • 4. About Me ● PhD Candidate in NTU EE ● Current research field: – Online Advertisement – Large Scale Predictive Modeling ● Organizer of Taiwan R User Group ● Organizer of Tutorial Program in DSC 2014
  • 5. Outline ● Share the experience of organizing tutorial program with 16 people with: – Git, my favorite tool of version control – Github, a platform of cooperation – Jenkins, a system of automation ● I will show how to cooperate these tools with R package
  • 6. Why R Package ● There are many dependency for examples and exercises ● R package is the recommended way to share your code ● Wrap all materials in one R Package: DSC2014Tutorial so the students only need to download once. – All slides are included. – Customized R API – All data – *Installation of depended packages – Solving issue of portability(Windows, Mac, and Ubuntu) ● The package is easily managed by git and released on github
  • 7. The structure of R package Dependencies ● DESCRIPTION Package: DSC2014Tutorial Type: Package Title: Materials of Tutorial Program on DSC 2014 Version: 1.2 Date: 2014-08-03 Author: Taiwan R User Group Maintainer: Wush Wu <wush978@gmail.com> Description: This package contains the required materials of R Tutorial DSC2014 License: GPL (>= 3) Depends: R (>= 3.1.0) Imports: tools, ...
  • 8. The structure of R package Data ● data data(salary, package = 'DSC2014Tutorial')
  • 9. The structure of R package cross-platform ● configure.ac / configure
  • 10. The structure of R package slides and external source system.file('Basic', package = 'DSC2014Tutorial')
  • 11. Git, Version Control ● Some speakers are new to git ● We used the following feature: – Self version control: add, commit – Repository: remote, push, pull, and merge – Cooperation: submodul ● Git plays the fundamental role in our workflow
  • 12. Why Git? ● Speed is king ● Local commits rock ● Github ●My favorite
  • 13. Github ● Most popular platform for managing git repository ● Provide many convenient features – Account of Organization – Designed for cooperation – Simple integration with many popular CI tools – Static website (Sufficient for R Repository)
  • 14. Release R Package on Github ● R is released as: – a git repository – a R repository
  • 15. Github and R Repository ● How to establish a R repository on github: 1.Create a new git repository named 『R』 2.Add the content of R repository into git repository in branch gghh--ppaaggeess 3. Push and wait 4. The R Repository is located at http://<account>.github.io/R ● The user could install the binary of DSC2014Tutorial directly via install.packages(DSC2014Tutorial, repos = "http://TaiwanRUserGroup.github.io/R")
  • 16. Cooperation ● I cannot build all slides of tutorial – There are 7 slides built from different groups of speakers ● Each slides should be managed by its author – Each slides is a standalone git repository – No branching here because not all speakers are familiear with git ● Use gitsubmodule to embed these slides into R Package ● We need modern work flow to control the quality
  • 17. Workflow 1 1.Each speakers creates the slides and initialize the git repository 2.Speakers commit their changes to git repository 3.Open the pull request 4.Slide review and test on different platform 5.Merge changes to DSC2014Tutorial
  • 21. Merge
  • 22. Slide Review ● Each speakers review the slides of each others ● The comment are posted to Issue of the github pages ● The speaker should resolve the posted issue
  • 24. Challenge ● After the first rehearsal on Taiwan R User Group, we notice a serious encoding issue – Default chinese encoding is different
  • 25. Challenge ● We could resolve the specific issue ● The slides are evolving, some bugs might occur ● We need to test the slides, but there are 7 slides and we want to test them on Windows, ubuntu and mac*
  • 26. Why CI ● CI automates the following things – Testing – Integration – Deployment ● CI makes me a better life ● CI also introduces some problems. Let's discuss it later.
  • 27. Test R Package ● R CMD check --no-codoc --no-manual --no-vignettes –no-build-vignettes
  • 28. Deploy R Package ● git push ● Commit to R Repository tools::write_PACKAGES( type = c("source", "mac.binary", "win.binary") )
  • 29. R and CI travis-ci.org
  • 30. Existed work for R and Travis-ci ● https://github.com/craigcitro/r-travis/wiki
  • 31. travis.yml language: c script: ./travis-tool.sh run_tests after_failure: - ./travis-tool.sh dump_logs before_install: - curl -OL http://raw.github.com/craigcitro/r-travis/ master/scripts/travis-tool.sh - chmod 755 ./travis-tool.sh - ./travis-tool.sh bootstrap - ./travis-tool.sh r_binary_install XML Rcpp knitr brew RUnit inline highlight formatR highr markdown rgl install: - ./travis-tool.sh install_deps - ./travis-tool.sh install_github hadley/testthat notifications: email: on_success: change on_failure: change env:
  • 32. R and CI jenkins
  • 33. Setup Jenkins ● Github Plugin – http://sanketdangi.com/post/62740311628/integrate-jenkins- github-trigger-build-process ● Github Pull Request Builder – http://www.kabisa.nl/building-github-pull-requests-with-jenkins/ ● Firewall (open to 192.30.252.0/22)
  • 36. Discussion ● No Error v.s. No Warnings ● Existed Problems: – Memory issue – Unknown Bugs – Unclear Message
  • 37. Summary ● Tutorial and R Package ● Git and R Package ● Github and R Package ● CI and R Package
  • 38. Q&A
  • 39. Thanks for your listening